简体   繁体   中英

Bundle install doesn't work - Rubymine - (Gem::InstallError: activesupport requires Ruby version >= 2.2.2.)

I am doing a project in Rubymine and I get a notice that I need to install some gems. When I do the bundle install I get the following error:

Gem::InstallError: activesupport requires Ruby version >= 2.2.2. An error occurred while installing activesupport (5.1.0), and Bundler cannot continue. Make sure that gem install activesupport -v '5.1.0' succeeds before bundling.

Process finished with exit code 5

I am using version 2.4.0 of Ruby, so I do not understand why I get this error.

Thanks for the help!

First check your ruby version.

$ which ruby
/Users/.rvm/rubies/ruby-2.1.2/bin/ruby
$ ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

Use the Ruby 2.4 version instead...

rvm install 2.4
rvm use 2.4

Rubymine has nothing to do with this.

As @Sunny commented out you need to make sure the ruby version you are using. I recommend you to create a new file on the app root directory, name it .ruby-version and inside add the ruby version you want ruby-2.4.0 (you can always modify it later and set a different versions).

Also you might want to use a ruby version manager like rvm or rbenv both are good, on my personal preference I use rbenv for development and rvm for production environments. You can follow this guide , feel free to change the OS and the ruby manager as you prefer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM