Reputation: 151
Catching this error under 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
I am using fresh rvm and ruby 1.9.3 and have same trouble only with json gem.
The error occurs when I try to execute:
gem install json
If I add sudo everything is ok, but I cannot (and shouldn't) use sudo with rvm commands.
Upvotes: 3
Views: 1272
Reputation: 1816
Try running below commands(works for ubuntu 14.04):
$ sudo apt-get install libgmp3-dev
and then install json
$ gem install json
Upvotes: 2
Reputation: 5111
For me this worked (a solution from @mjgpy3)
sudo apt-get install ruby-json
Upvotes: 0