尝试在OS X Mountain Lion上安装rails(10.8.4)。我安装了自制软件和rvm。 Ruby(2.0.0p247)已正确安装。但是,当我尝试使用
安装rails时$ gem install rails
我最终得到以下错误:
Building native extensions. This could take a while...
/Users/myname/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile
make "DESTDIR="
compiling atomic_reference.c
atomic_reference.c:50:9: warning: implicit declaration of function
'OSAtomicCompareAndSwap64' is invalid in C99
[-Wimplicit-function-declaration]
if (OSAtomicCompareAndSwap64(expect_value, new_value, &DATA_PTR(self))) {
^
1 warning generated.
linking shared-object atomic_reference.bundle
make "DESTDIR=" install
/usr/bin/install -c -m 0755 atomic_reference.bundle ./.gem.20130714-19171-3oplrw
installing default atomic_reference libraries
ERROR: While executing gem ... (NoMethodError)
undefined method `join' for nil:NilClass
我已经更新了我的所有gemsets,并尝试将“gem update --system”作为this post推荐,但无济于事。
另外,如果有帮助
$ rvm gemset list
提供
gemsets for ruby-2.0.0-p247 (found in /Users/myname/.rvm/gems/ruby-2.0.0-p247)
(default)
=> global
note 我首先尝试使用rbenv安装rails,但在安装后它无法识别我安装了它。所以我卸载了rbenv和rails,现在我正在尝试关注this tutorial但是我收到了上述错误。
有什么建议吗?
答案 0 :(得分:1)
看起来Rails 4.0需要RubyGems 2.0.3,所以命令是
gem update --system 2.0.3
然后按
安装railsgem install rails