Error during rails installation Ubuntu 12.04

折月煮酒 提交于 2019-12-10 12:58:26

问题


I'm installing rails on Ubuntu machine, so far I got no problems reading the following tutorials:

https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm http://pragashblog.blogspot.com/2012/05/setting-up-rvm-ruby-and-rails-on-ubuntu.html

However when I try to install rails:

gem install rails

I'm getting the following error:

Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.3-p374/bin/ruby extconf.rb
creating Makefile

make
compiling generator.c
make: I.: Command not found
make: [generator.o] Error 127 (ignored)
linking shared-object json/ext/generator.so
make: shared: Command not found
make: [generator.so] Error 127 (ignored)

make install
compiling generator.c
make: I.: Command not found
make: [generator.o] Error 127 (ignored)
linking shared-object json/ext/generator.so
make: shared: Command not found
make: [generator.so] Error 127 (ignored)
 /usr/bin/install -c -m 0755 generator.so /usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-    1.7.6/lib/json/ext
/usr/bin/install: cannot stat `generator.so': No such file or directory
make: *** [/usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6/lib/json/ext/generator.so] Error 1


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6 for inspection.
 Results logged to /usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6/ext/json/ext/generator/gem_make.out

Obviously I already checked that make is available, and that it is on the PATH. In fact, which make and which which rvm give the following results: /usr/bin/make /usr/local/rvm/bin/rvm

So... I don't think it's related to PATH.

Any Ideas?? What should I do?


回答1:


you are missing required packages:

rvm get head
rvm requirements run
rvm remove 1.9.3
rvm use 1.9.3 --install --default
gem install rails



回答2:


I had the same issue...running 'rvm reinstall 1.9.3' after 'sudo apt-get install build-essentials' fixed it for me. I guess maybe ruby didn't notice when I installed gcc, and still believed I didn't have it.



来源:https://stackoverflow.com/questions/14635232/error-during-rails-installation-ubuntu-12-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!