在 Ubuntu 12.04 下捕获此错误:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/home/allaud/.rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
creating Makefile
make
compiling generator.c
linking shared-object json/ext/generator.so
gcc: error: generator.o: No such file or directory
make: *** [generator.so] Ошибка 1
Gem files will remain installed in /home/allaud/.rvm/gems/ruby-1.9.3-p392/gems/json-1.7.7 for inspection.
Results logged to /home/allaud/.rvm/gems/ruby-1.9.3-p392/gems/json-1.7.7/ext/json/ext/generator/gem_make.out
我正在使用新的 rvm 和 ruby 1.9.3,并且只有 json gem 有同样的问题。
当我尝试执行时发生错误:
gem install json
如果我添加 sudo 一切正常,但我不能(也不应该)将 sudo 与 rvm 命令一起使用。