Ruby Mine complains that "Cannot switch SDK." even if the SDK is there and available Ruby Mine complains that "Cannot switch SDK." even if the SDK is there and available ruby ruby

Ruby Mine complains that "Cannot switch SDK." even if the SDK is there and available


I found for a similar problem (Rubymine 6.3.1 and Ruby 2.1.1) that I had to format .ruby-version in the following way:

ruby-2.1.1

Note the prefix 'ruby-" to the version number. I'm not sure whether this is an RVM, Ruby, Rubymine, or some other issue that caused this problem, but the fix I mentioned worked on my Mac.


I am not sure if this is the case, but you might be telling rubymine to use a different ruby version, and it uses that version on all the commands, that's why it shows the errors on each interaction with ruby.

You need to change the running configuration, from the menu choose: Run > Edit configuration

Then you'll find few settings on the left, choose the one that you use to run your project, and on the right check for Ruby SDK, choose the correct ruby version from the list, and click ok. Every thing should be fine, you might need to bundle because gems aren't shared between different ruby versions.


FYI this issue has been already reported to JetBrains RUBY-15058 and it seems they will work on adding "ruby-" prefix if missing.