1
我剛安裝rbenv使用Ruby 1.9.3安裝1.9.3,錯誤信息factory_girl需要Ruby版本> = 1.9.2
rbenv version
1.9.3-p327 (set by /Users/me/.rbenv/version)
然而,當我試圖運行包更新(一個項目,在裏面在安裝rbenv之前創建的),我得到了一個錯誤消息,factory_girl至少需要ruby 1.9.2。看到下面的錯誤消息
如果它是相關的,當我做寶石 - 版本,我看到一個參考1.8.23。
gem --version
1.8.23
錯誤消息
Installing factory_girl (4.1.0) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:163:in `install': factory_girl requires Ruby version >= 1.9.2. (Gem::InstallError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:268:in `update'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
更新:
第一個答案告訴我,做三個步驟
gem install bundle
rbenv rehash
bundle install
我沒有這些步驟(它安裝捆綁)「
gem install bundler
Fetching: bundler-1.2.3.gem (100%)
Successfully installed bundler-1.2.3
1 gem installed
但是當我嘗試'捆綁安裝,我得到了關於Factory_girl相同的錯誤信息。有趣的是,我決定再次嘗試這三個步驟,從gem install bunlder開始,並且再次安裝它?!#?
我按照你的步驟,但得到了相同的結果。有趣的是,當我得到相同的結果後,我再次嘗試了你的步驟(只是爲了確定),它'寶石安裝bunlder'安裝捆綁器第二次,這對我來說沒有意義。它不需要再安裝一次嗎? – Leahcim
不知道,也許你的rbenv環境有問題。你在Mac上使用zsh或bash? – number5