无法在轨道上安装红宝石

时间:2012-07-31 15:19:40

标签: ruby-on-rails rubygems fedora

我正在

ERROR:  While executing gem ... (NameError) uninitialized constant Gem::RemoteFetcher::OpenSSL

当我尝试运行时

# gem install rails
我已经

  • Ruby v1.8.7
  • Gem(rubygems.nonarch)v1.7.2

安装。

任何想法我应该做什么?


现在正在运行sudo gem install rails给我:

ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.7.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.7.4/ext/json/ext/generator/gem_make.out


通过YUM安装的所有内容

运行Fedora 15

3 个答案:

答案 0 :(得分:5)

我在做#gem install rake时遇到了类似的问题,但我发现我的系统是在代理服务器后面,所以我尝试通过这个命令提供代理地址:

gem install rake -p http//IPaddress:proxyport (put : after http)  

它对我有用,之后没有这样的错误。

答案 1 :(得分:0)

点击rvm requirements。您没有安装libssl-dev

➜  ~  rvm requirements

Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10" )

NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
             This is the *original* / standard Ruby Language Interpreter
      'ree'  represents Ruby Enterprise Edition
      'rbx'  represents Rubinius

bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).

To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.

Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
  ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

# For JRuby, install the following:
  jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
  jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk

# For IronRuby, install the following:
  ironruby: /usr/bin/apt-get install curl mono-2.0-devel

我不知道Fedora的要求与Ubuntu的要求有何不同,但这可能仅限于包名。

答案 2 :(得分:0)

我在Ubuntu上遇到了与gem install相同的问题。它现在正在工作,我认为我所做的就是通过防火墙启用ssl。

看起来好像gem在响应无法建立SSL连接时返回此错误,可能是在尝试处理失败时。

罗素