无法在rvm上安装rails3

时间:2011-04-15 17:05:01

标签: rvm ruby-on-rails-3

尝试使用rvm安装rails3时,出现以下错误。

$ gem install rails
/data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/config_file.rb:28:in `<top (required)>': uninitialized constant Gem::ConfigFile (NameError)
        from /data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:8:in `<top (required)>'
        from /data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /data/home/manish/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin/gem:9:in `<main>'

这是我的rvm信息

$ rvm info

ruby-1.9.2-p180:

  system:
    uname:       "Linux alioth-linux.gslab.com 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:55:12 EDT 2007 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 3.2.25(1)-release (i386-redhat-linux-gnu)"
    zsh:         "/bin/zsh => zsh 4.3.4 (i386-redhat-linux-gnu)"

  rvm:
    version:      "rvm 1.6.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.2p180"
    date:         "2011-02-18"
    platform:     "i686-linux"
    patchlevel:   "2011-02-18 revision 30909"
    full_version: "ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]"

  homes:
    gem:          "/data/home/manish//.rvm/gems/ruby-1.9.2-p180"
    ruby:         "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180"

  binaries:
    ruby:         "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin/ruby"
    irb:          "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin/irb"
    gem:          "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin/gem"
    rake:         "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin/rake"

  environment:
    PATH:         "/data/home/manish//.rvm/gems/ruby-1.9.2-p180/bin:/data/home/manish//.rvm/gems/ruby-1.9.2-p180@global/bin:/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/bin:/data/home/manish//.rvm/bin:/data/home/manish/ec2-api-tools-1.4.0.2/bin:/data/data/work/java/jdk1.6.0_18/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/data/home/manish//bin"
    GEM_HOME:     "/data/home/manish//.rvm/gems/ruby-1.9.2-p180"
    GEM_PATH:     "/data/home/manish//.rvm/gems/ruby-1.9.2-p180:/data/home/manish//.rvm/gems/ruby-1.9.2-p180@global"
    MY_RUBY_HOME: "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180"
    IRBRC:        "/data/home/manish//.rvm/rubies/ruby-1.9.2-p180/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

感谢您的帮助 问候,
和Manish

3 个答案:

答案 0 :(得分:1)

待办事项

rvm rubygems remove

然后会说:

  

删除旧的Rubygems文件......

     

安装专用于ruby-1.9.2-p180的rubygems ...

之后gem命令工作。

编辑:没关系,似乎还有更多内容。

答案 1 :(得分:0)

升级到Ubuntu 11.04时,我遇到了完全相同的错误消息,发现我安装了rvm,同时缺少一些基本库。

我知道你没有像我一样使用与Linux相同的Linux;以下工作对我来说,你可能找到一个等价物:

$ sudo apt-get install build-essential ruby-full bison openssl libreadline5 libreadline5-dev curl git-core zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libmysqlclient-dev libxslt-dev libxml2-dev libcurl4-openssl-dev #install the missing libraries

$ rm -r ~/.rvm* # destroy the old rvm installation

$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) # install rvm again

$ rvm install 1.9.2

答案 2 :(得分:0)

我在Ubuntu 10.04上遇到了同样的问题。

在RVM安装脚本输出中,它指示需要哪些Ubuntu软件包。 例如,在我的系统上它有:

build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

使用apt-get,'rvm implode'安装,并重新运行'rvm install 1.9.2'解决了这个问题。