简体   繁体   English

在rails安装Ubuntu 12.04期间出错

[英]Error during rails installation Ubuntu 12.04

I'm installing rails on Ubuntu machine, so far I got no problems reading the following tutorials: 我在Ubuntu机器上安装rails,到目前为止我在阅读以下教程时没有遇到任何问题:

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 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 /设置-UP-RVM,红宝石和护栏上,ubuntu.html

However when I try to install rails: 但是当我尝试安装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. 显然我已经检查过make是否可用,并且它已经在PATH上了。 In fact, which make and which which rvm give the following results: /usr/bin/make /usr/local/rvm/bin/rvm 事实上, 哪个和哪个rvm给出了以下结果:/ usr / bin / make / usr / local / rvm / bin / rvm

So... I don't think it's related to PATH. 所以......我不认为这与PATH有关。

Any Ideas?? 有任何想法吗?? What should I do? 我该怎么办?

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

I had the same issue...running 'rvm reinstall 1.9.3' after 'sudo apt-get install build-essentials' fixed it for me. 我遇到了同样的问题...在'sudo apt-get install build-essentials'之后运行'rvm reinstall 1.9.3'为我修复了它。 I guess maybe ruby didn't notice when I installed gcc, and still believed I didn't have it. 我想也许红宝石没有注意到我安装gcc时,仍然相信我没有它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM