Ruby on rails 3.1 Rails在Lion上不起作用

Ruby on rails 3.1 Rails在Lion上不起作用,ruby-on-rails-3.1,osx-lion,rvm,Ruby On Rails 3.1,Osx Lion,Rvm,我把我的MacOSX版本改成了Lion。但是,我无法创建Rails3应用程序 我使用RVM1.9.2,选择ruby 1.9.2-p290创建Rails 3应用程序 一切似乎都很好。当我开始创建新应用程序时 rails new new_my_app 我看到这个错误, Installing json (1.6.6) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem nati

我把我的MacOSX版本改成了Lion。但是,我无法创建Rails3应用程序

我使用RVM1.9.2,选择ruby 1.9.2-p290创建Rails 3应用程序

一切似乎都很好。当我开始创建新应用程序时

rails new new_my_app
我看到这个错误,

Installing json (1.6.6) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
creating Makefile

make
sh: make: command not found


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection.
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out
An error occured while installing json (1.6.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.6'` succeeds before bundling.
当我尝试

gem install json -v '1.6.6'
我面对这个错误

Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

        /Users/ender/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
creating Makefile

make
sh: make: command not found


Gem files will remain installed in /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6 for inspection.
Results logged to /Users/ender/.rvm/gems/ruby-1.9.2-p290/gems/json-1.6.6/ext/json/ext/generator/gem_make.out
我应该如何解决此问题


谢谢。

您需要安装osx gcc安装程序

如果您从previoys系统迁移了ruby,则需要重新安装ruby和gems:

rvm reinstall 1.9.2
rvm use 1.9.2
rvm gemset pristine

我有这个问题,这个为我解决了。我最近从一个旧系统迁移到一个新的iMac

我首先安装了libksba。我不确定是否有必要,但我想不会有什么伤害。我使用了,所以这就是我所做的:

brew install libksba
然后,我更新了rvm

rvm get head
更新后,它通知我需要安装ruby-1.9.3-p194

rvm install ruby-1.9.3-p194
安装了1.9.3。我想要1.9.2版本的一些旧应用,所以我重新安装了它

rvm reinstall 1.9.2
最后,我安装了导致此问题的json gem:

gem install json -v '1.6.6'
中提琴!它安装正确。我做的最后一件事是运行bundle,但它抱怨没有找到:

Could not find multi_json-1.3.1 in any of the sources
我删除了Gemfile.lock并重新运行了包

rm Gemfile.lock
bundle

现在一切都好了

我终于赢了。也许这是一个简单的方法。你知道的。 首先,我更新了RVM,但在此之前,我从应用商店为Lion安装了Xcode 4。第二步是重新安装最新的StabilRuby版本并创建我的gemset。
最后,我将rails 3.2下载到我之前在ruby上最新设置的gem集合中。

您需要在Xcode 4 for Lion的首选项中安装“命令行工具”。

这个和这个-->最终使我的捆绑包再次工作!这个链接在一个新的osx mountain lion安装上为我工作,它给了我这个错误。和@Catfish一样。我的时间机器在新的SSD上恢复了操作系统,当时还以为命令行工具已经出现了。事实并非如此。解决了,谢谢!另外,请确保在安装命令行工具后重新启动。希望它能帮别人省去一些痛苦