1

尝试在 OS X Mountain Lion (10.8.4) 上安装 rails。我安装了自制软件和 rvm。Ruby (2.0.0p247) 已正确安装。但是,当我尝试使用

$ 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”,但是无济于事。

另外,如果有帮助

$ rvm gemset list

提供

gemsets for ruby-2.0.0-p247 (found in /Users/myname/.rvm/gems/ruby-2.0.0-p247)
(default)
=> global

请注意,我确实首先尝试使用 rbenv 安装 rails,但安装后它不会识别出我安装了它。因此,我卸载了 rbenv 和 rails,现在尝试按照本教程进行操作,但出现上述错误。

有什么建议么?

4

1 回答 1

1

看起来 Rails 4.0 需要 RubyGems 2.0.3,所以命令是

gem update --system 2.0.3

然后安装导轨

gem install rails
于 2013-07-15T14:56:21.287 回答