【发布时间】:2013-02-21 13:23:00
【问题描述】:
这里有很多关于 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...
如何让 bundle 与 RVM 配合使用?
【问题讨论】:
-
gem install factory_girl -v '3.6.2'的输出是什么? -
@PauloHenrique 我添加了输出 - 必须以超级用户身份运行。
-
Weel,那么你没有使用 rvm。请将 rvm list 的输出也放入 plz。
标签: ruby-on-rails ruby rvm bundler