本文介绍了在rails安装Ubuntu 12.04期间出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu机器上安装rails,到目前为止,我没有遇到任何问题,请阅读以下教程:




然而,当我尝试安装rails时:

gem install rails



出现以下错误:

 构建原生扩展。这可能需要一段时间... 
错误:安装rails出错:
错误:无法构建gem本机扩展。

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

make
编译生成器.c
make:I:命令未找到
make:[generator.o]错误127(忽略)
链接共享对象json / ext / generator.so
make:shared:找不到命令
make:[generator.so]错误127(忽略)

make install
编译generator.c
make:I. :未找到命令
make:[generator.o]错误127(忽略)
链接共享对象json / ext / generator.so
make:shared:找不到命令
make:[generator.so]错误127(忽略)
/ 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:can not stat'generator.so':没有这样的文件或目录
make:*** [/ usr / local / rvm /gems/ruby-1.9.3-p374/gems/json-1.7.6/lib/json/ext/generator.so]错误1


Gem文件将保持安装在/ USR /本地/ RVM /宝石/红宝石1.9.3-P374 /宝石/json-1.7.6进行检查。
结果记录到/usr/local/rvm/gems/ruby-1.9.3-p374/gems/json-1.7.6/ext/json/ext/generator/gem_make.out

显然我已经检查过make是否可用,并且它在PATH上。实际上,使 哪个rvm 给出以下结果的
/ usr / bin / make
/ usr / local / rvm / bin / rvm



所以...我不认为它与PATH有关。



任何想法?我应该怎么做?

  rvm get head 
rvm require run
rvm remove 1.9.3
rvm use 1.9.3 --install --default
gem install导轨


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-rvmhttp://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?

解决方案

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

这篇关于在rails安装Ubuntu 12.04期间出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:37