QuestionEverything
QuestionEverything

Reputation: 5097

In RubyMine: "Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)"

I've created a ruby on rails project with rails composer. I can run the project from terminal, but when I open it in RubyMine, it's showing this error

Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)

I have checked my ruby version using 'ruby -v' and it says

ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]

My rails version using 'rails -v'

Rails 3.2.13

However, when I open the project in RubyMine(version: 5.4.1) it says

/path/to/my/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler/definition.rb:361:in `validate_ruby!': Your Ruby version is 2.0.0, but your Gemfile specified 1.9.3 (Bundler::RubyVersionMismatch)

The SDK version in RubyMine is showing 'RVM: ruby-2.0.0-p195' and the language level is 1.9

I have checked other threads on this error, but none of them was working in terminal and showing error in RubyMine. How can I solve this?

Upvotes: 1

Views: 6454

Answers (1)

Martin M
Martin M

Reputation: 8638

In RubyMine you can manage multiple SDKs, meaning ruby version and gemset.
Obviously you selected a SDK with ruby-2.0.0-p195.

The language level only defines the syntax higliting and command completion help etc. say the support of the IDE, but not the ruby version used for the project.

So you should select a different SDK (or create it first, but as you use rmv and RubyMine knows rmv, you should see all your SDKs)

If ruby-1.9.3 is your system default, you might install the same version again with rvm to make it available for RubyMine

rvm install ruby-1.9.3

and then select it in RubyMine.

Upvotes: 5

Related Questions