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.
terminal
■ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin19]
■bundler -v
Bundler version 1.7.4
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!
Why the local ruby version has gone up I would like to investigate. .. ..