Fre*_*rtz 45 ruby json ruby-on-rails
我正在阅读Rails教程,由于json gem的问题,我无法完成'bundle install'.当我尝试直接安装它时:
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
如上所述,ruby版本是2.2.3.
me@tru2:~/rails/hello_app$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
运行'gem list'表示当前安装了json 1.8.1,但默认Gemfile中的某些内容必须要求1.8.3.搜索显示了许多类似的问题,但没有答案让我超越了这个问题.我试过用sudo运行它似乎工作但回到我身边的问题仍然存在.
alf*_*alf 146
cannot find -lgmp意味着它无法找到gmp库.试试跑步:
sudo apt-get install libgmp3-dev
https://github.com/flori/json/issues/253
尝试运行rvm implode然后按照本指南进行操作http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
我怀疑 RVM 没有为您包含正确的标头。
| 归档时间: | 
 | 
| 查看次数: | 10603 次 | 
| 最近记录: |