无法使用捆绑器安装 gem

发布于 2024-12-11 05:47:51 字数 1448 浏览 0 评论 0原文

我无法使用捆绑器安装 gem,它总是失败并显示 Can't find;尽管我确实在 gemfile 中将 ruby​​gems 定义为源,但在任何源 消息中。

另外,我通常可以使用 gem install 安装 gem,我曾经手动安装失败的宝石,然后运行捆绑安装,以便它看到它们已经安装,但这并没有不再工作了。

我曾经使用 rvm,厌倦了这个问题(并认为是它造成的),所以我改用 rbenv 但无济于事。我正在运行 1.9.2-p290。

我正在运行 Mac OS Lion。谢谢!

gem env 输出:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /Users/X/.rbenv/versions/1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
     - /Users/X/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.github.com", "http://rubygems.org", "http://gemcutter.org"]
  - REMOTE SOURCES:
     - http://gems.github.com
     - http://rubygems.org
     - http://gemcutter.org

$which gem
/Users/X/.rbenv/shims/gem

$ which ruby
/Users/X/.rbenv/shims/ruby

I can't install gems with bundler, it always fail with a Can't find <inser-gem-name-here> in any of the sources message although I do have rubygems defined as a source in my gemfile.

Also, I can normally install gems with gem install <gem-name>, I used to install the ones that fail manually and then run bundle install so that it sees them as already installed, but that doesn't wrok anymore.

I used to use rvm, got tired of this issue (and thought it caused it) so I switched to rbenv to no avail. I'm running 1.9.2-p290.

I'm running Mac OS Lion. Thanks!

gem env output:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.10
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.2.0]
  - INSTALLATION DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /Users/X/.rbenv/versions/1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/X/.rbenv/versions/1.9.2-p290/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-11
  - GEM PATHS:
     - /Users/X/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1
     - /Users/X/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.github.com", "http://rubygems.org", "http://gemcutter.org"]
  - REMOTE SOURCES:
     - http://gems.github.com
     - http://rubygems.org
     - http://gemcutter.org

Also

$which gem
/Users/X/.rbenv/shims/gem

And

$ which ruby
/Users/X/.rbenv/shims/ruby

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦幻的味道 2024-12-18 05:47:51

我有一个类似的问题,我设法通过导出我的 http_proxy 来解决

导出http_proxy=http://用户:密码@主机:端口

希望这有帮助。

I had a similar problem, that I managed to resolve by exporting my http_proxy

export http_proxy=http://user:password@host:port

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文