Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
522 views
in Technique[技术] by (71.8m points)

bundler - Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0

In my Gemfile I specified ruby version 2.0.0:

ruby '2.0.0'

But my console tells me I have 2.1.0dev:

$ ruby -v
ruby 2.1.0dev (2013-09-16 trunk 42951) [x86_64-darwin12.4.0]

I am using rbenv and it tells my I don't have 2.1.0 installed,

$ rbenv versions
system
* 2.0.0-dev

Bundle update or bundle install says:

"Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0"

but using 'rbenv local 2.0.0-dev' leaves me with ruby 2.1.0dev again. Furthermore:

$ rbenv global
2.0.0-dev

$ cat ~/.bash_profile:
export PATH="$HOME/.rbenv/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

As far as I know, 2.1.0dev doesn't even exist yet.

How can i get ruby 2.0.0 selected?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You may need to update your version of ruby-build to make sure you have the update where ruby-2.0.0-dev switched to follow the ruby_2_0_0 branch.

Try running ruby-build --version and make sure it's one of these (or later):

  • v20130907
  • v20130901
  • v20130806
  • v20130628
  • v20130518
  • v20130514
  • v20130501
  • v20130408
  • v20130227
  • v20130226
  • v20130225

If not, run brew upgrade ruby-build.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...