-1

我以通常的方式安装了 RVM:

curl -L https://get.rvm.io | bash -s stable --ruby

在安装过程中显示了这些消息:

ruby-1.9.3-p286 - #configure
ruby-1.9.3-p286 - #download
(...)
ruby-1.9.3-p286 - #extract
ruby-1.9.3-p286 - #validate
ruby-1.9.3-p286 - #setup
'ruby' was not found, cannot install rubygems unless ruby is present (Do you have an RVM ruby installed & selected?)
Saving wrappers to '/home/rmaruszewski/.rvm/bin'.
ruby-1.9.3-p286 - #importing default gemsets (/home/rmaruszewski/.rvm/gemsets/)
Creating alias default for ruby-1.9.3-p286.
Recording alias default for ruby-1.9.3-p286.
Creating default links/files
Saving wrappers to '/home/rmaruszewski/.rvm/bin'.

“'ruby' was not found”消息很可疑......

而且,当我打电话时gem list,列表是空的。

*** LOCAL GEMS ***

但后来我打电话给rvm use ruby@globalthen gem list,我得到:

*** LOCAL GEMS ***

bundler (1.2.1)
rake (0.9.2.2)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)

所以,显然,我的“全局”gemset 在“default”gemset 中是不可见的。你能告诉我为什么吗?

这是rvm info“全局”gemset 的输出:

ruby-1.9.3-p286@global:

  system:
    uname:       "Linux rmaruszewski 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "ubuntu/12.04/x86_64"
    bash:        "/bin/bash => GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.16.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "12 minutes 37 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p286"
    date:         "2012-10-12"
    platform:     "x86_64-linux"
    patchlevel:   "2012-10-12 revision 37165"
    full_version: "ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]"

  homes:
    gem:          "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global"
    ruby:         "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286"

  binaries:
    ruby:         "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/ruby"
    irb:          "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/irb"
    gem:          "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/gem"
    rake:         "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global/bin/rake"

  environment:
    PATH:         "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global/bin:/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin:/home/rmaruszewski/.rvm/bin:/home/rmaruszewski/bin:/home/rmaruszewski/bin/build:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt:/opt/AccurevTools/bin:/opt/accurev/bin:/home/rmaruszewski/bin/gitscripts:/srv/git/development/tools/gts/bin:/srv/git/build/Build:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/opt/grails/bin:/opt/gradle/bin"
    GEM_HOME:     "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global"
    GEM_PATH:     "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global"
    MY_RUBY_HOME: "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286"
    IRBRC:        "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/.irbrc"
    RUBYOPT:      ""
    gemset:       "global"

这是针对“默认”宝石集的:

ruby-1.9.3-p286:

  system:
    uname:       "Linux rmaruszewski 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux"
    system:      "ubuntu/12.04/x86_64"
    bash:        "/bin/bash => GNU bash, version 4.2.24(1)-release (x86_64-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.16.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "18 minutes 26 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p286"
    date:         "2012-10-12"
    platform:     "x86_64-linux"
    patchlevel:   "2012-10-12 revision 37165"
    full_version: "ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]"

  homes:
    gem:          "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286"
    ruby:         "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286"

  binaries:
    ruby:         "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/ruby"
    irb:          "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/irb"
    gem:          "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin/gem"
    rake:         "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global/bin/rake"

  environment:
    PATH:         "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286/bin:/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global/bin:/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/bin:/home/rmaruszewski/.rvm/bin:/home/rmaruszewski/bin:/home/rmaruszewski/bin/build:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt:/opt/AccurevTools/bin:/opt/accurev/bin:/home/rmaruszewski/bin/gitscripts:/srv/git/development/tools/gts/bin:/srv/git/build/Build:/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:/opt/grails/bin:/opt/gradle/bin"
    GEM_HOME:     "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286"
    GEM_PATH:     "/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286:/home/rmaruszewski/.rvm/gems/ruby-1.9.3-p286@global"
    MY_RUBY_HOME: "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286"
    IRBRC:        "/home/rmaruszewski/.rvm/rubies/ruby-1.9.3-p286/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
4

2 回答 2

2

我想我遇到了同样的问题,除了在 Mac OSX 10.7 上。

我是红宝石新手。我正在阅读 netuts 教程 (http://net.tutsplus.com/tutorials/ruby/singing-with-sinatra-the-recall-app-2/)。

我安装了 RVM,升级到最新的 Ruby(mac 自带 1.8.7),将 rvm 设置为默认为 1.9.3,gem 安装了 sinatra、datamapper 等,但是当我尝试在 IRB 或.rb 文件,我收到“LoadError: cannot load such file -- datamapper”错误。

我 gem 安装了 data_mapper ,这似乎有效,但是,这似乎是某种我不明白的配置问题。

我发帖是因为我看到 RVM (1.16.17) 和 ruby​​ (1.9.3-p286) 的版本与您相同,并且我的 gem 列表 --local (rvm 1.11.3.5) 中的 RVM 版本相同。

不确定我如何拥有 RVM 1.16.17 并且 gem 说 rvm 1.11.3.5。此外,rubygems 应该在 1.9 中“包含”,但在 irb 中,如果我键入 require “rubygems”,它会返回 false。

我讨厌成为一个 n00b ......对不起,我没有答案。

于 2012-11-03T01:52:03.837 回答
1

您是否首先使用了红宝石:

rvm use ruby
于 2012-11-01T04:29:13.847 回答