【问题标题】:Bundler could not find compatible versions for gem "bundler": In Gemfile: rails (= 3.0.0) was resolved to 3.0.0, which depends on bundler (~> 1.0.0)Bundler 找不到 gem "bundler" 的兼容版本:在 Gemfile:rails (= 3.0.0) 被解析为 3.0.0,这取决于 bundler (~> 1.0.0)
【发布时间】:2017-01-09 18:54:02
【问题描述】:

我刚买了一个新的 MBP,我正在尝试执行一个 ruby​​ 应用程序。在我遵循本教程Install Ruby on Rails 5.0 · macOS Sierra之后, 我仍然有这个问题:

MBP:test_app $ gem install rails
Successfully installed rails-5.0.1
Parsing documentation for rails-5.0.1
Done installing documentation for rails after 0 seconds
1 gem installed
MBP:test_app $ rails new .
Could not find gem 'rails (= 3.0.0)' in any of the gem sources listed in your Gemfile or available on this machine.
Try running `bundle install`.

然后,我尝试了:

$ bundle install

我收到以下错误:

Fetching gem metadata from http://rubygems.org/..........
Fetching version metadata from http://rubygems.org/..
Fetching dependency metadata from http://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.0) was resolved to 3.0.0, which depends on
      bundler (~> 1.0.0)

  Current Bundler version:
    bundler (1.13.7)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.0.0)', which is required by gem 'rails (=
3.0.0)', in any of the sources.

我想我已经尝试了所有方法;安装 bundler 1.0.0,重新安装,删除 gems,删除 ruby​​、rails、rvm,然后重新安装所有内容。

请问有什么建议吗?

【问题讨论】:

  • 您在 gemfile 中明确声明了bundler 1.0.0,但它仍然不起作用?然后我会检查你的其他 gem,看看它们中的任何一个是否依赖于较新版本的 bundler,因为有些东西正在将你的 Bundler 版本移动到 1.13.7
  • 另外你为什么要安装 rails 5.0.1,但在你的 gemfile 中却需要 rails 3.0.0?您希望您的项目使用哪个版本的 Rails?
  • 您是否有机会在 Gemset 中工作?我建议先安装捆绑器gem install bundler,然后再安装gem install rails
  • @BigRon 我不需要 3.0.0。我只是想运行我的第一个应用程序。我需要改变什么吗?
  • @DarioBarrionuevo 我做了,但我仍然有问题

标签: ruby-on-rails ruby rubygems rvm bundler


【解决方案1】:

解决了!!

问题已解决,在development.rb 文件中删除或评论config.action_view.debug_rjs = true

谢谢大家!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-08-14
    • 2011-10-31
    • 2017-07-17
    • 2018-02-09
    • 2014-05-26
    • 2014-03-14
    • 2013-03-13
    • 2019-05-07
    相关资源
    最近更新 更多