I am looking through a Rails tutorial and I cannot complete the “package installation” due to a json gem problem. When I try to install it directly:
me@tru2:~/rails/hello_app$ gem install json -v '1.8.3' Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension. /home/me/.rvm/rubies/ruby-2.2.3-dev/bin/ruby -r ./siteconf20150820-12793-qdkev7.rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.so /usr/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status make: *** [generator.so] Error 1 make failed, exit code 2 Gem files will remain installed in /home/me/.rvm/gems/ruby-2.2.3-dev/gems/json-1.8.3 for inspection. Results logged to /home/me/.rvm/gems/ruby-2.2.3-dev/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out
As mentioned, the ruby version is 2.2.3.
me@tru2:~/rails/hello_app$ ruby --version ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
Running "gem list" shows that json 1.8.1 is currently installed, but something in the Gemfile should require 1.8.3 by default. The search revealed many similar questions, but no answers that made me pass this problem. I tried working with sudo and it seems to work, but coming back to me, the problem still exists.
json ruby ruby-on-rails
Fred Snertz Aug 21 '15 at 0:41 2015-08-21 00:41
source share