RVM won't let me run bundle
because it thinks my Ruby version is different from what my Gemfile says, but it isn't:
$ rvm list
rvm rubies
=> ruby-1.9.3-p194 [ x86_64 ]
ruby-1.9.3-p429 [ x86_64 ]
* ruby-2.0.0-p195 [ x86_64 ]
# => - current
# =* - current && default
# * - default
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin13.0.0]
Gemfile:
ruby '1.9.3-p194'
But then:
$ bundle install
Your Ruby version is 1.9.3, but your Gemfile specified 1.9.3-p194
$
This seems like a very strange thing. Any ideas? There are a lot of people who have this question, but their Gemfiles are obviously different from the running version. I've even done rvm use 1.9.3-p194
and then immediately after bundle install
but I get the same error. bundle update
produces the same error.
If I remove the ruby version from the Gemfile, it will default to 2.0.0 but switching by rvm use
to the proper version (to comply with remote server ruby version) actually works. Running bundle install
then works.
Could this error come from also having an rvmrc file (even though specifies the same ruby version) in the Rails project as well?
Remove the line and add a file named '.ruby-version' with '1.9.3-p194' in it. The .ruby-version approach is compatible with several ruby managers beyond rvm.
The entry in your Gemfile should simply be
ruby '1.9.3'