我目前正在尝试开始我的第一个rails项目,当我尝试运行命令rails new file_name
时,我最终得到错误ERROR: Failed to build gem native extension.
我目前正在使用rvm在我的mac osx 10.8.5上运行ruby 2.2。每次我运行rails时,json gem似乎都失败了。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
我很遗憾发生了什么事。如果我尝试运行安装json,我也会失败构建本机扩展错误。它可能是我的xcode命令行工具的版本,因为当我尝试运行xcode-select --install时,它说命令不存在?我不知道。任何帮助将不胜感激。
按照莱昂纳多的要求编辑:
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/davidgarczynski/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150817-32366-1n36tmw.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling generator.c
make: I.: No such file or directory
make: [generator.o] Error 1 (ignored)
linking shared-object json/ext/generator.bundle
make: dynamic: No such file or directory
make: [generator.bundle] Error 1 (ignored)
make "DESTDIR=" install
compiling generator.c
make: I.: No such file or directory
make: [generator.o] Error 1 (ignored)
linking shared-object json/ext/generator.bundle
make: dynamic: No such file or directory
make: [generator.bundle] Error 1 (ignored)
/usr/bin/install -m 0755 generator.bundle ./.gem.20150817-32366-b8ng6y/json/ext
install: generator.bundle: No such file or directory
make: *** [install-so] Error 71
make install failed, exit code 2
Gem files will remain installed in /Users/davidgarczynski/.rvm/gems/ruby-2.2.1/gems/json-1.8.3 for inspection.
Results logged to /Users/davidgarczynski/.rvm/gems/ruby-2.2.1/extensions/x86_64-darwin-14/2.2.0-static/json-1.8.3/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that
gem install json -v'1.8.3'succeeds before bundling.