无法找到宝石,但宝石安装没有问题

时间:2015-11-30 18:28:35

标签: ruby-on-rails ruby gem bundle bundler

每当我运行rails服务器或规范时,我都会收到此错误:

Could not find debugger-1.6.8 in any of the sources

当我运行gem install debugger时,它运作正常:

Building native extensions.  This could take a while...
Successfully installed debugger-1.6.8
1 gem installed
Installing ri documentation for debugger-1.6.8...
Installing RDoc documentation for debugger-1.6.8...
(eval):5: warning: regular expression has ']' without escape: /\[a-z]+/

但是捆绑列表没有显示调试器-1.6.8:

* daemons (1.2.3)
* delayed_job (4.0.3)
* delayed_job_active_record (4.1.0)
* diff-lcs (1.2.5)
* domain_name (0.5.25)
* double-bag-ftps (0.1.2)

我也没有阻止安装任何gem的.bundle/config文件。

这是我的Gemfile,其中包含:test和:development group:

group :test, :development do
  gem 'sqlite3', '1.3.9'
  gem 'rspec-rails', '~> 2.14.2'
  gem 'pry'
  gem 'awesome_print', '1.2.0'
  gem 'debugger', platform: :mri_19
  gem 'byebug' if RUBY_VERSION >= '2.0.0'
end

当我删除平台规范时,我收到此错误:

An error occurred while installing debugger (1.6.8), and Bundler cannot continue.
Make sure that `gem install debugger -v '1.6.8'` succeeds before bundling.

我正在使用rbenv运行ruby 1.9.3-p551。

如何将调试器gem安装到项目包中,以便运行我的服务器和测试?

1 个答案:

答案 0 :(得分:3)

重新安装'\n'bundler gem(通过brew)。有时这些安装可能会变坏,当bundler和rbenv去设置你的宝石时,你机器上的权限会很难过。