1

最近,我的红宝石遇到了很多麻烦。

现在,每当我尝试bundle install在我的项目上运行时,我都会收到以下错误:

 bundle install
/usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-        1.3.5/lib/bundler/rubygems_integration.rb:172:in `security_policies': uninitialized constant Gem::Security::Policies (NameError)
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:175:in `<class:CLI>'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:6:in `<module:Bundler>'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/lib/bundler/cli.rb:5:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/gems/bundler-1.3.5/bin/bundle:18:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/bundle:23:in `load'
from /usr/local/rvm/gems/ruby-2.0.0-p247@global/bin/bundle:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'

我试过重新安装红宝石,我试过rvm get headgem update --system

rvm package我还尝试通过和卸载并重新安装 OpenSSL brew install

而且我已经尝试完全破坏 RVM 并重新开始,但这似乎都不起作用。这似乎发生在我转会到小牛队之后。

有没有人知道可能会发生什么?我在这呆了3天...

编辑:

我对所有这些红宝石都有同样的问题:

  • 1.9.3
  • 2.0.0-p195
  • 2.0.0-p247
  • 2.1.0-预览1
4

3 回答 3

2

Assuming you're using brew...

  1. Run brew doctor to check the current state and perform any steps it recommends.

  2. Run rvm list and note which versions of ruby are installed. Remove the offending ruby version with rvm remove 2.0.x where 'x' is the minor revision you are working with, or run rvm remove 2.0 to remove them all.

  3. Now upgrade to the latest rvm, rvm get stable.

  4. Let rvm install dependencies automatically by running rvm autolibs enable. This will allow rvm to install whatever it needs during the ruby installation, including openssl. It will use brew, as I am assuming here, but will also use fink or macports if they are installed instead. In the past I have had problems with brew and macports both installed.

  5. Install the latest ruby via rvm, rvm install 2.0.

Bundler should now work.

于 2013-11-25T17:47:20.347 回答
1

在 OSX Mavericks 上运行 Ruby 2.0 和 Rails 4.0 的新 rvm gemset 上运行 bundle install 时,我收到了同样的错误:

gems/bundler-1.3.5/lib/bundler/rubygems_integration.rb:172:in `security_policies':    uninitialized constant Gem::Security::Policies (NameError)

运行“brew install openssl”,然后“rvm reinstall 2.0”对我有用。

于 2013-11-15T07:56:20.823 回答
0

您是否尝试过在捆绑安装中使用 --trust-policy=[] 选项?应用名为 policy 的 Rubygems 安全策略,其中 policy 是 HighSecurity、MediumSecurity、LowSecurity 或 NoSecurity 之一。更多 - http://bundler.io/v1.3/man/bundle-install.1.html

于 2013-11-13T05:03:42.603 回答