Ruby-on-rails 从 RVM Gemset 中删除 Gem?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3454179/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 23:01:05  来源:igfitidea点击:

Remove Gem from RVM Gemset?

ruby-on-railsrubygemsrspecrvm

提问by Meltemi

New to RVM and playing with Rails 3 & Ruby 1.9.2 betas...

刚接触 RVM 并使用 Rails 3 和 Ruby 1.9.2 测试版...

I've got two copies of rspec in a gemset. Was using beta.19 but need to downgrade to beta.18. changed my gemfile and then bundle install. now i have a mess...

我在一个 gemset 中有两个 rspec 副本。正在使用 beta.19,但需要降级到 beta.18。更改了我的 gemfile,然后bundle install. 现在我一团糟...

*** LOCAL GEMS ***
. . .
rspec (2.0.0.beta.19, 2.0.0.beta.18)
rspec-core (2.0.0.beta.19, 2.0.0.beta.18)
rspec-expectations (2.0.0.beta.19, 2.0.0.beta.18)
rspec-mocks (2.0.0.beta.19, 2.0.0.beta.18)
rspec-rails (2.0.0.beta.19, 2.0.0.beta.18)

and I would like to remove all traces of beta.19 but can't seem to find out how.

我想删除 beta.19 的所有痕迹,但似乎无法找到方法。

Though the Gemfile is requiring beta.18, beta.19 is still running interference...and rspec is barfing all over my log files...

尽管 Gemfile 需要 beta.18,但 beta.19 仍然在运行干扰……而且 rspec 在我的日志文件中到处都是……

Edit: Thanks to Nikita I was able to remove the beta.19 gems. now i'm getting a broken path or something:

编辑:感谢 Nikita,我能够移除 beta.19 宝石。现在我得到了一条破碎的路径或其他东西:

thismac:rails_app meltemi$ spec -v
/Library/Ruby/Site/1.8/rubygems.rb:335:in `bin_path': can't find executable spec for rspec-2.0.0.beta.18 (Gem::Exception)
    from /usr/bin/spec:19
mymac:appname meltemi$

is there something i need to do to rebuild now that 19 is gone and i'm falling back to 18?

既然 19 岁已经过去,我又要回到 18 岁了,我还需要做些什么来重建吗?

回答by Nikita Rybak

How about gem uninstall rspec -v=2.0.0.beta.19? Check gem help uninstallfor details.

怎么样gem uninstall rspec -v=2.0.0.beta.19?检查gem help uninstall详细信息。

Or you can just uninstall all versions and then install the one you need.

或者您可以卸载所有版本,然后安装您需要的版本。

回答by mastaBlasta

I had some similar issues with RVM due to the global and default gemsets. In my case the offending gems were in the @global gemsets and i was only able to remove them by doing

由于全局和默认 gemset,我在 RVM 上遇到了一些类似的问题。在我的情况下,违规的宝石在@global gemsets 中,我只能通过执行以下操作来删除它们

rvm @global do gem uninstall the-gem-name

Other commands like rvm all-gemsets do...and rvm all do...did not work

其他命令像rvm all-gemsets do...并且rvm all do...不起作用

See this thread

看到这个线程

How do I use RVM and create globally available gems?

如何使用 RVM 并创建全局可用的 gems?

and the doc

和文档

http://rvm.io/set/do

http://rvm.io/set/do

回答by Jake

I had the same error message but what I needed to do was add the rspec rails to my :development group as well as :test, YMMV

我有同样的错误消息,但我需要做的是将 rspec rails 添加到我的 :development 组以及 :test, YMMV