为什么RVM gem列表显示我没有安装的gem?

时间:2012-01-16 22:24:22

标签: ruby rubygems rvm shared-hosting dreamhost

我在Dreamhost共享主机上。我安装了RVM来运行Ruby 1.9.2,并创建了一个空的gemset来使用。我在它上面运行gemset empty命令以确保它真的是空的。

奇怪的是,如果我运行rvm gemset use MYGEMSET然后运行rvm do gem list,我会获得Dreamhost提供的一长串宝石。

[phantom]$ rvm do gem list
WARN: `rvm do gem list` is deprecated, use `rvm all do gem list` or `rvm 1.9.2 do gem list` instead.

*** LOCAL GEMS ***

Invalid gemspec in [/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec]: /usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec:12: invalid multibyte char (UTF-8)
/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec:12: syntax error, unexpected tIDENTIFIER, expecting keyword_end
...d heavily on Mauricio Fern?ndez's implementation in rpa-base...
...                               ^
/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec:31: syntax error, unexpected tFLOAT, expecting keyword_end
...rsion) >= Gem::Version.new('1.2.0') then
...                               ^
/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec:31: no .<digit> floating literal anymore; put 0 before dot
...sion) >= Gem::Version.new('1.2.0') then
...                               ^
/usr/lib/ruby/gems/1.8/specifications/archive-tar-minitar-0.5.1.gemspec:31: unterminated string meets end of file
abstract (1.0.0)
actionmailer (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
actionpack (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
actionwebservice (1.2.6, 1.2.3)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
activeresource (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
activesupport (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
acts_as_taggable (2.0.2, 1.0.4)
ajax_scaffold_generator (3.1.11, 2.2.1)
archive-tar-minitar (0.5.2)
arel (2.0.4)
auth_generator (2.0.1, 1.5.3)
Bloglines4R (0.1.0)
BlueCloth (1.0.0)
builder (2.1.2, 2.0.0)
bundler (1.0.7)
bunny (0.6.0)
camping (1.5.180, 1.5)
capistrano (2.5.1, 2.1.0, 1.4.1)
cgi_multipart_eof_fix (2.5.0)
chef (0.10.2)
classifier (1.3.1)
cmdparse (2.0.2, 2.0.0)
curb (0.1.4)
daemons (1.0.10, 1.0.9)
dbd-mysql (0.4.3)
dbi (0.4.3)
deprecated (2.0.1)
erubis (2.6.6)
eventmachine (0.12.10, 0.12.8)
facets (2.2.1, 1.8.54)
fastthread (1.0.7, 1.0.1)
feedtools (0.2.29, 0.2.28)
ferret (0.11.6, 0.11.4)
flickr (1.0.2)
gd2 (1.1.1, 1.1)
gem_plugin (0.2.3)
gen (0.41.0)
geoip (0.6.1)
gettext (1.90.0)
glue (0.41.0)
gnuplot (2.2)
gravtastic (2.0.0)
gruff (0.3.1)
haml (2.0.3)
highline (1.6.2)
hoe (2.7.0)
hpricot (0.6)
htmltools (1.10)
i18n (0.4.2, 0.4.1)
json (1.5.1)
localization_generator (1.0.8)
login_generator (1.2.2)
logstash-lite (0.2.20110206003603)
madeleine (0.7.3)
mail (2.2.15)
markaby (0.5)
mechanize (0.7.6)
metaid (1.0)
mime-types (1.16)
mini_magick (1.2.3)
mixlib-authentication (1.1.0)
mixlib-cli (1.1.0)
mixlib-config (1.1.2)
mixlib-log (1.3.0)
moneta (0.6.0)
mongrel (1.1.5, 1.1.4)
mysql (2.7)
needle (1.3.0)
net-scp (1.0.4)
net-sftp (2.0.5, 1.1.1)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
net-ssh-multi (1.1, 1.0.1)
nitro (0.41.0)
nokogiri (1.4.4)
og (0.41.0)
ohai (0.6.0)
oniguruma (1.1.0)
packet (0.1.14)
PageTemplate (2.2.0)
ParseTree (2.1.1)
payment (1.0.1)
pdf-writer (1.1.8)
podcast (0.0.4)
polyglot (0.3.1)
rack (1.2.1, 1.1.0, 1.0.1, 1.0.0)
rack-mount (0.6.13)
rack-test (0.5.6)
radiant (0.6.9)
rails (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
railties (3.0.3)
rake (0.8.7)
RedCloth (3.0.4)
rest-client (1.6.3)
rfacebook (0.9.8)
rmagick (1.15.14)
rspec (1.1.3)
ruby-breakpoint (0.5.1)
ruby-debug (0.10.0)
ruby-openid (2.1.7)
ruby-yadis (0.3.4)
ruby_odeum (0.4.1)
rubyforge (2.0.4)
RubyInline (3.6.7)
rubypants (0.2.0)
rubyzip (0.9.1)
ruport (1.6.0)
ruport-util (0.14.0)
ruwiki (0.9.3)
salted_login_generator (2.0.2)
shipping (1.5.1)
SimpleSearch (0.5.0)
sqlite3-ruby (1.2.1)
stemmer (1.0.1)
switchtower (1.0.1)
syntax (1.0.0)
systemu (2.2.0)
tagtools (0.0.3)
thin (1.2.5, 1.2.2)
thor (0.14.6, 0.14.4)
tidy (1.1.2)
treetop (1.4.9)
tzinfo (0.3.23)
unicode (0.1)
uuidtools (1.0.3)
webgen (0.4.7)
wee (0.10.0)
xhtmldiff (1.0.0)
xml-simple (1.0.11)
yajl-ruby (0.8.2)
ym4r (0.6.1)
youtube-g (0.4.9.9)

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
actionpack (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
actionwebservice (1.2.6, 1.2.3)
activemodel (3.0.3)
activerecord (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
activeresource (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
activesupport (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
acts_as_taggable (2.0.2, 1.0.4)
ajax_scaffold_generator (3.1.11, 2.2.1)
archive-tar-minitar (0.5.2, 0.5.1)
arel (2.0.4)
auth_generator (2.0.1, 1.5.3)
Bloglines4R (0.1.0)
BlueCloth (1.0.0)
builder (2.1.2, 2.0.0)
bundler (1.0.7)
bunny (0.6.0)
camping (1.5.180, 1.5)
capistrano (2.5.1, 2.1.0, 1.4.1)
cgi_multipart_eof_fix (2.5.0)
chef (0.10.2)
classifier (1.3.1)
cmdparse (2.0.2, 2.0.0)
curb (0.1.4)
daemons (1.0.10, 1.0.9)
dbd-mysql (0.4.3)
dbi (0.4.3)
deprecated (2.0.1)
erubis (2.6.6)
eventmachine (0.12.10, 0.12.8)
facets (2.2.1, 1.8.54)
fastthread (1.0.7, 1.0.1)
feedtools (0.2.29, 0.2.28)
ferret (0.11.6, 0.11.4)
flickr (1.0.2)
gd2 (1.1.1, 1.1)
gem_plugin (0.2.3)
gen (0.41.0)
geoip (0.6.1)
gettext (1.90.0)
glue (0.41.0)
gnuplot (2.2)
gravtastic (2.0.0)
gruff (0.3.1)
haml (2.0.3)
highline (1.6.2)
hoe (2.7.0)
hpricot (0.6)
htmltools (1.10)
i18n (0.4.2, 0.4.1)
json (1.5.1)
localization_generator (1.0.8)
login_generator (1.2.2)
logstash-lite (0.2.20110206003603)
madeleine (0.7.3)
mail (2.2.15)
markaby (0.5)
mechanize (0.7.6)
metaid (1.0)
mime-types (1.16)
mini_magick (1.2.3)
mixlib-authentication (1.1.0)
mixlib-cli (1.1.0)
mixlib-config (1.1.2)
mixlib-log (1.3.0)
moneta (0.6.0)
mongrel (1.1.5, 1.1.4)
mysql (2.7)
needle (1.3.0)
net-scp (1.0.4)
net-sftp (2.0.5, 1.1.1)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
net-ssh-multi (1.1, 1.0.1)
nitro (0.41.0)
nokogiri (1.4.4)
og (0.41.0)
ohai (0.6.0)
oniguruma (1.1.0)
packet (0.1.14)
PageTemplate (2.2.0)
ParseTree (2.1.1)
payment (1.0.1)
pdf-writer (1.1.8)
podcast (0.0.4)
polyglot (0.3.1)
rack (1.2.1, 1.1.0, 1.0.1, 1.0.0)
rack-mount (0.6.13)
rack-test (0.5.6)
radiant (0.6.9)
rails (3.0.3, 2.3.8, 2.3.5, 2.3.4, 2.3.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)
railties (3.0.3)
rake (0.8.7)
RedCloth (3.0.4)
rest-client (1.6.3)
rfacebook (0.9.8)
rmagick (1.15.14)
rspec (1.1.3)
ruby-breakpoint (0.5.1)
ruby-debug (0.10.0)
ruby-openid (2.1.7)
ruby-yadis (0.3.4)
ruby_odeum (0.4.1)
rubyforge (2.0.4)
RubyInline (3.6.7)
rubypants (0.2.0)
rubyzip (0.9.1)
ruport (1.6.0)
ruport-util (0.14.0)
ruwiki (0.9.3)
salted_login_generator (2.0.2)
shipping (1.5.1)
SimpleSearch (0.5.0)
sqlite3-ruby (1.2.1)
stemmer (1.0.1)
switchtower (1.0.1)
syntax (1.0.0)
systemu (2.2.0)
tagtools (0.0.3)
thin (1.2.5, 1.2.2)
thor (0.14.6, 0.14.4)
tidy (1.1.2)
treetop (1.4.9)
tzinfo (0.3.23)
unicode (0.1)
uuidtools (1.0.3)
webgen (0.4.7)
wee (0.10.0)
xhtmldiff (1.0.0)
xml-simple (1.0.11)
yajl-ruby (0.8.2)
ym4r (0.6.1)
youtube-g (0.4.9.9)

我有两个问题:

  1. 如何为我的项目创建一个真正的孤岛,一个真正空的宝石集?
  2. 如何摆脱本地宝石中的“无效gemspec”错误?因为如果我切换回rvm use 1.8.7然后运行gem list会收到“无效的gemspec”错误!

  3. 修改

    键入rvm use ruby-1.9.2@MYGEMSET,然后运行which gem指向我认为正确的~/.rvm/rubies/ruby-1.9.2-p290/bin/gem

3 个答案:

答案 0 :(得分:2)

rvm do gem list已弃用

rvm gemset list: List your gemsets

rvm gemset create your_gemset: Create a gemset

rvm gemset use your_gemset: Use a gemset

gem list: List current gemset gems

使用rvm info检查您使用的是正确的ruby和gemset。最佳做法是创建.rvmrc文件

答案 1 :(得分:2)

最有可能发生这种情况是因为全局gemset包含all个宝石,请尝试:

rvm 1.9.2@global gem list

你可以将它与宝石列表进行比较,只看你的宝石:

rvm use 1.9.2
diff --normal <(gem list) <( rvm 1.9.2@global gem list ) | sed '/^[^<]/ d ; s/^< //'

或仅将GEM_HOME用作GEM_PATH

GEM_PATH=$GEM_HOME gem list

答案 2 :(得分:0)

我相信rvm do gem list将列出所有红宝石(以及所有宝石组)的宝石。如果你有正确的rvm设置和源代码,你应该能够使用所有的shell脚本(ruby,gem,bundle等等)而不用rvm作为前缀。

使用正确的ruby版本+ gemset(即:gem list)后尝试rvm use ruby-1.9.2@MY_GEMSET。如果这会产生奇怪的结果,请查看您使用which gem的宝石。