这里有很多关于 Ruby 版本和 RVM 的问题 - 我已经查看了它们,但找不到针对我的具体问题的解决方案:
据我所知,我已经正确安装和设置/配置了 RVM。
$ ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-darwin12.2.0]
但是,在运行 bundle install 时,我收到以下消息:
$ bundle install
Updating http://github.com/rails/prototype_legacy_helper.git
Fetching gem metadata from http://rubygems.org/......
Fetching gem metadata from http://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (10.0.3)
Using RedCloth (4.2.9)
Using i18n (0.6.1)
Using multi_json (1.6.1)
Using activesupport (3.2.12)
Using builder (3.0.4)
Using activemodel (3.2.12)
Using erubis (2.7.0)
...
...
Using eventmachine (1.0.0)
Using excon (0.17.0)
Installing factory_girl (3.6.2)
Gem::InstallError: factory_girl requires Ruby version >= 1.9.2.
An error occurred while installing factory_girl (3.6.2), and Bundler cannot continue.
Make sure that `gem install factory_girl -v '3.6.2'` succeeds before bundling.
对我来说,重要的一行factory_girl requires Ruby version >= 1.9.2.
让我认为 bundle 不尊重 RVM 设置使用的 ruby 版本。不过,我不确定我的配置哪里出错了。我以前从未遇到过 RVM 的问题。确实,gem install factory_girl -v '3.6.2'
可以正常工作,但是 bundle 之后仍然看不到它。
手动安装 factory_girl 的输出:
$ sudo gem install factory_girl -v '3.6.2'
Password:
Successfully installed factory_girl-3.6.2
1 gem installed
Installing ri documentation for factory_girl-3.6.2...
Installing RDoc documentation for factory_girl-3.6.2...
如何让捆绑包与 RVM 一起玩得很好?