[RUBY] [Programming beginner] What to do when rails s becomes an error in the local development environment

Status

When I tried to launch the rails server as usual in the terminal,

terminal


user@usernoMacBook-Air app name% rails s
Traceback (most recent call last):
	5: from bin/rails:3:in `<main>'
	4: from bin/rails:3:in `load'
	3: from /Users/user/app name bin/spring:10:in `<top (required)>'
	2: from /Users/user/app name/bin/spring:10:in `new'
	1: from /System/Library/Frameworks/Ruby.framework/Versions/
2.6/usr/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby
/2.6.0/bundler/
lockfile_parser.rb:108:in `warn_for_outdated_bundler_version'
: You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)

I got the above error and the server suddenly stopped booting.

environment

terminal



■ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin19]

■bundler -v
Bundler version 1.7.4

What went

Because bundler is already installed

terminal


sudo gem update bundler

When you do

terminal


Your Ruby version is 2.6.3, but your Gemfile specified 2.5.3

Will come out. The ruby version of the app I'm developing is 2.5.3 For some reason, the ruby version of Mac's local development environment has become 2.6.3. (Maybe I upgraded without being aware of it) The above was displayed because the version is different.

I have already created a production environment for deploying on AWS, and the version of ruby in the production environment is Since it was 2.5.3, I want to unify the version with 2.5.3,

terminal


rbenv local 2.5.3
(Considering the possibility of developing other apps locally using rails in the future
Only this project is daringly local, not rbenv global 2.5.I specified to use 3)

terminal


source ~/.bash_profile

The server is now up!

from now on

Why the local ruby version has gone up I would like to investigate. .. ..

Recommended Posts

[Programming beginner] What to do when rails s becomes an error in the local development environment
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do when ‘Could not find’ in any of the sources appears in the development environment with Docker × Rails × RSpec
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
What to do and how to install when an error occurs in DXRuby 1.4.7
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
What to do when the value becomes null in the second getSubmittedValue () in JSF Validator
What to do when rails db: seed does not reflect in the database
What to do if ffi installation fails when launching an application in Rails
What to do if you get an "A server is already running." Error when you try to start the rails server
[Rails] I want to reset everything because the data in the local environment is strange! What to do before that
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do when Address already in use is displayed after executing rails s
What to do when you launch an application with rails
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
[Rails] What to do if you can't get an error message with the errors method
What to do when Rails on Docker does not reflect controller changes in the browser
What to do if you get an error in Basic authentication during Rails test code
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
What to do when an error occurs in rails db: migrate ((StandardError: An error has occurred, this and all later migrations canceled :))
What to do when the changes in the Servlet are not reflected
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if Cloud9 is full in the Rails tutorial
[Rails] What to do when rails s does not respond or does not stop
What to do when an error (StandardError: An error has occurred, this and all later migrations canceled:) appears in rails db: migrate
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
After learning Progate, I tried to make an SNS application using Rails in the local environment
What to do if an error occurs when doing npm install axios in React + Typescript project
What to do when Blocked Host: "host name" appears in Ruby on Rails
What to do if an error occurs when nokogiri enters when bundle install
I want to display an error message when registering in the database
What to do if you get an error when you hit Heroku logs
Resolved the error that occurred when trying to use Spark in an environment where Java 8 and Java 11 coexist.
What to do if the image posted by refile disappears after setting a 404 error page in Rails
Puma --Nignx is an escape route when rails s -e production -d doesn't work in the environment
Rails6.0 ~ How to create an eco-friendly development environment
What to do when IllegalStateException occurs in PlayFramework
[Grails] Error occurred running What to do when the Grails CLI does not start
What to do if build from command line fails in Android development environment
[Rails] What to do when the Refile image is not displayed when writing the processing at the time of Routing Error
When I tried to start GlassFish, I got an internal error while "Publishing to GlassFish 4.0 on localhost ...". What to do when it becomes
[React.useRef] What to do when the latest state cannot be referenced in the event listener
What to do if the Rails server can't start
What to do when The SSL certificate has expired
What to do if you can't get the text of an element in Selenium
[Rails] How to delete production environment MySQL data after putting it in the development environment
About the solution of the error that occurred when trying to create a Japanese file of devise in the Docker development environment
What to do when a null byte error occurs
What to do when rails creates a 〇〇 2.rb file
What to do if an ActionController :: UnknownFormat error occurs
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do when "Fail to load the JNI shared library" is displayed in Eclipse
What to do if Failure / Error: require File.expand_path ('../ config / environment', __dir__) appears in RSpec
What to do if you get the error Couldn't find Item without an ID
[Rails] What to do when you want to generate an error that cannot be destory when foreign key restrictions are applied
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
SSL in the local environment of Docker / Rails / puma
I got an error when trying to install sbt to build a Scala development environment
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
[Rails] How to display an image in the view