Rails不适用于Lion

ndr*_*x42 4 rvm ruby-on-rails-3.1 osx-lion

我将Mac OSX版本更改为Lion.但是我无法创建Rails3应用程序.

我使用rvm 1.9.2并选择ruby 1.9.2-p290来创建Rails 3 app.

一切似乎都很好.当我开始创建一个新的应用程序

rails new new_my_app
Run Code Online (Sandbox Code Playgroud)

我看到这个错误,

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.
Run Code Online (Sandbox Code Playgroud)

当我尝试

gem install json -v '1.6.6'
Run Code Online (Sandbox Code Playgroud)

我面对这个错误

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
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能解决这个问题?

谢谢.

gok*_*gok 10

您需要从Xcode 4 for Lion中的首选项安装"命令行工具".

  • 这和 - > http://stackoverflow.com/questions/9027772/failed-to-build-json-1-6-3-with-native-extension-after-i-installed-xcode-4-2最后让我的捆绑再次运作! (2认同)