【问题标题】:Bundler::GemNotFound: Could not find rake-10.3.2 in any of the sourcesBundler::GemNotFound:在任何源中都找不到 rake-10.3.2
【发布时间】:2014-07-11 04:48:13
【问题描述】:

我一直在使用 Rails,它给我发回了这个错误。请提供问题。感谢所有的帮助。我会用一个更好的问题来更新这个问题,因为我不知道该怎么问。

Bundler::GemNotFound: Could not find rake-10.3.2 in any of the sources
~/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.6.2/lib/bundler/spec_set.rb:92:in `block in materialize'
~/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in `map!'
~/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.6.2/lib/bundler/spec_set.rb:85:in `materialize'
~/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.6.2/lib/bundler/definition.rb:133:in `specs'
~/.rvm/gems/ruby-2.0.0-p451/gems/bundler-1.6.2/lib/bundler/definition.rb:178:in `specs_for'
Show 28 more lines

我确定我的 rake 是最新版本

宝石文件

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'devise', '3.0.2'
gem "seo_helper", "~> 1.0.2"
gem "open_graph_helper"

gem "rmagick"
gem "carrierwave"
gem "carrierwave-meta"

gem "settingslogic"

gem "anjlab-bootstrap-rails", "2.3.1.2", :require => "bootstrap-rails"
gem "bootstrap_helper", ">= 4.2.2.1"
gem "simple_form", "~> 3.0.1" 
gem "will_paginate", "3.0.3"
gem "font-awesome-rails", "~> 3.2.1.3"

gem "high_voltage"

gem "airbrake"

gem "rvm-capistrano"
gem 'rake', '~> 10.3.2'
gem "omniauth"
gem "omniauth-facebook"
gem "auto-facebook", "0.42"


gem "whenever"

gem "hipchat"

# Cache
gem "dalli"

gem "compass-rails", "~> 1.1.2"

group :development do
  gem "capistrano"
  gem "capistrano-ext"
  gem "cape"
  gem "binding_of_caller"
  gem "better_errors", "~> 0.9.0"
  gem "magic_encoding"
  gem "annotate"
  gem "powder"
  gem "pry-nav"
  gem "pry-remote"
end

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.1)
      actionpack (= 4.1.1)
      actionview (= 4.1.1)
      mail (~> 2.5.4)
    actionpack (4.1.1)
      actionview (= 4.1.1)
      activesupport (= 4.1.1)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.1)
      activesupport (= 4.1.1)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.1)
      activesupport (= 4.1.1)
      builder (~> 3.1)
    activerecord (4.1.1)
      activemodel (= 4.1.1)
      activesupport (= 4.1.1)
      arel (~> 5.0.0)
    activesupport (4.1.1)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    airbrake (3.1.17)
      builder
      multi_json
    anjlab-bootstrap-rails (2.3.1.2)
      railties (>= 3.0)
      sass (>= 3.2)
    annotate (2.6.3)
      activerecord (>= 2.3.0)
      rake (>= 0.8.7)
    arel (5.0.1.20140414130214)
    auto-facebook (0.42)
      omniauth
      omniauth-facebook
      rails (>= 4.0.0)
    bcrypt (3.1.7)
    bcrypt-ruby (3.1.5)
      bcrypt (>= 3.1.3)
    better_errors (0.9.0)
      coderay (>= 1.0.0)
      erubis (>= 2.6.6)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    bootstrap_helper (4.2.3)
      railties (>= 4.0.0)
      thor (~> 0.14)
      will_paginate (>= 3.0.3)
    builder (3.2.2)
    cape (1.8.0)
    capistrano (2.15.5)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    capistrano-ext (1.2.1)
      capistrano (>= 1.0.0)
    carrierwave (0.10.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
    carrierwave-meta (0.0.5)
      activesupport (>= 3.0)
      carrierwave (>= 0.5.7)
      mime-types
    chronic (0.10.2)
    chunky_png (1.3.1)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.0)
    compass (0.12.6)
      chunky_png (~> 1.2)
      fssm (>= 0.2.7)
      sass (~> 3.2.19)
    compass-rails (1.1.7)
      compass (>= 0.12.2)
      sprockets (<= 2.11.0)
    dalli (2.7.2)
    debug_inspector (0.0.2)
    devise (3.0.2)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      warden (~> 1.2.3)
    erubis (2.7.0)
    execjs (2.0.2)
    faraday (0.9.0)
      multipart-post (>= 1.2, < 3)
    font-awesome-rails (3.2.1.3)
      railties (>= 3.2, < 5.0)
    fssm (0.2.10)
    hashie (2.1.1)
    high_voltage (2.1.0)
    highline (1.6.21)
    hike (1.2.3)
    hipchat (1.1.0)
      httparty
    httparty (0.13.1)
      json (~> 1.8)
      multi_xml (>= 0.5.2)
    i18n (0.6.9)
    jbuilder (2.0.7)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (3.1.0)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.1)
    jwt (0.1.13)
      multi_json (>= 1.5)
    magic_encoding (0.0.2)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    method_source (0.8.2)
    mime-types (1.25.1)
    minitest (5.3.4)
    multi_json (1.10.1)
    multi_xml (0.5.5)
    multipart-post (2.0.0)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (2.9.1)
    net-ssh-gateway (1.2.0)
      net-ssh (>= 2.6.5)
    oauth2 (0.9.3)
      faraday (>= 0.8, < 0.10)
      jwt (~> 0.1.8)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (~> 1.2)
    omniauth (1.2.1)
      hashie (>= 1.2, < 3)
      rack (~> 1.0)
    omniauth-facebook (1.6.0)
      omniauth-oauth2 (~> 1.1)
    omniauth-oauth2 (1.1.2)
      faraday (>= 0.8, < 0.10)
      multi_json (~> 1.3)
      oauth2 (~> 0.9.3)
      omniauth (~> 1.2)
    open_graph_helper (0.2.0)
    orm_adapter (0.5.0)
    polyglot (0.3.4)
    powder (0.2.1)
      thor (>= 0.11.5)
    pry (0.9.12.6)
      coderay (~> 1.0)
      method_source (~> 0.8)
      slop (~> 3.4)
    pry-nav (0.2.3)
      pry (~> 0.9.10)
    pry-remote (0.1.8)
      pry (~> 0.9)
      slop (~> 3.0)
    rack (1.5.2)
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (4.1.1)
      actionmailer (= 4.1.1)
      actionpack (= 4.1.1)
      actionview (= 4.1.1)
      activemodel (= 4.1.1)
      activerecord (= 4.1.1)
      activesupport (= 4.1.1)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.1)
      sprockets-rails (~> 2.0)
    railties (4.1.1)
      actionpack (= 4.1.1)
      activesupport (= 4.1.1)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.3.2)
    rdoc (4.1.1)
      json (~> 1.4)
    rmagick (2.13.2)
    rvm-capistrano (1.5.1)
      capistrano (~> 2.15.4)
    sass (3.2.19)
    sass-rails (4.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0)
    sdoc (0.4.0)
      json (~> 1.8)
      rdoc (~> 4.0, < 5.0)
    seo_helper (1.0.2)
    settingslogic (2.0.9)
    simple_form (3.0.2)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    slop (3.5.0)
    spring (1.1.3)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.1.3)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    sqlite3 (1.3.9)
    thor (0.19.1)
    thread_safe (0.3.3)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    turbolinks (2.2.2)
      coffee-rails
    tzinfo (1.1.0)
      thread_safe (~> 0.1)
    uglifier (2.5.0)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    warden (1.2.3)
      rack (>= 1.0)
    whenever (0.9.2)
      activesupport (>= 2.3.4)
      chronic (>= 0.6.3)
    will_paginate (3.0.3)

PLATFORMS
  ruby

DEPENDENCIES
  airbrake
  anjlab-bootstrap-rails (= 2.3.1.2)
  annotate
  auto-facebook (= 0.42)
  better_errors (~> 0.9.0)
  binding_of_caller
  bootstrap_helper (>= 4.2.2.1)
  cape
  capistrano
  capistrano-ext
  carrierwave
  carrierwave-meta
  coffee-rails (~> 4.0.0)
  compass-rails (~> 1.1.2)
  dalli
  devise (= 3.0.2)
  font-awesome-rails (~> 3.2.1.3)
  high_voltage
  hipchat
  jbuilder (~> 2.0)
  jquery-rails
  magic_encoding
  omniauth
  omniauth-facebook
  open_graph_helper
  powder
  pry-nav
  pry-remote
  rails (= 4.1.1)
  rmagick
  rvm-capistrano
  sass-rails (~> 4.0.3)
  sdoc (~> 0.4.0)
  seo_helper (~> 1.0.2)
  settingslogic
  simple_form (~> 3.0.1)
  spring
  sqlite3
  turbolinks
  uglifier (>= 1.3.0)
  whenever
  will_paginate (= 3.0.3)

我试过bundle install rakebundle update 但还是不行。 感谢大家的帮助。

【问题讨论】:

  • 请尝试捆绑安装 --system
  • 我试过了,还是一样的错误
  • 只需删除您的 Gemfile.lock 并运行 bundle install 或尝试 bundle update rake
  • 请添加 gem "rack", "1.4.5" 并执行 "bundle update" 或尝试 bundle update rake
  • 我添加并运行包更新,Bundler 找不到 gem "rack" 的兼容版本:在 Gemfile:rails (= 4.1.1) ruby​​ 依赖于 actionpack (= 4.1.1) ruby​​ 依赖于机架 (~> 1.5.2) 红宝石机架 (1.4.5)

标签: ruby-on-rails rake


【解决方案1】:
bundle config set --local path 'vendor/cache'

通常会修复它,因为这是更常见的问题。基本上,您的捆绑程序路径配置搞砸了。请参阅他们的documentation(第一段)了解在哪里可以找到这些配置并在需要时手动更改它们。

【讨论】:

  • 这绝对可以通过提供一个有效的原因来改进,更具体地说,它是做什么的。
  • 现在我可以在 ruby​​mine 中调试了 :)
  • 我认为真正要运行的命令是 bundle install --no-deployment - 感谢 Bundler 在我删除 Gemfile.lock 时的这条消息:“如果这是一台开发机器,请通过运行 bundle install --no-deployment 来消除 Gemfile 冻结。”
  • 该命令被标记为已弃用。但是,您仍然可以运行 bundle config set path 'vendor/cache'。 "[已弃用] --path 标志已被弃用,因为它依赖于在捆绑程序调用中被记住,而捆绑程序在未来版本中将不再这样做。请改用 bundle config set path 'vendor/cache',并停止使用此标志"
  • 如果你最近遇到这个问题,选择的答案仍然是准确的,但是你现在会从 bundler 收到这个警告:``` [DEPRECATED] --path 标志已被弃用因为它依赖于在捆绑器调用中被记住,捆绑器在未来的版本中将不再这样做。请改为使用 `bundle config set path 'vendor/cache' ``` 仅供参考。
【解决方案2】:

我的同事告诉我,它可以通过禁用弹簧来解决。 对于 docker 用户:

docker exec -ite DISABLE_SPRING=1 [container_name] rails c

【讨论】:

    【解决方案3】:

    捆绑器 2

    如果您需要从 bundler v1 更新到 v2,请关注official guide

    对于快速解决方案:

    1. 在您的应用程序的根目录中运行bundle config set path "/bundle" 以添加自定义路径以供捆绑器使用,在这种情况下我设置/bundle,您可以使用任何东西。

      1.2 [替代解决方案]您可以使用捆绑器文件 (~/.bundle/config),我建议使用它设置捆绑器文件夹在环境中,例如 Docker 映像。 Here the official guide.

    2. 您不需要删除您的Gemfile.lock,这是一种不好的做法,这可能会导致其他未来问题。提交 Gemfile.lock 正常,有时您需要使用 bundle install 更新您的包或安装单独的 gem。

    您可以查看捆绑程序版本 2 here 的所有配置。

    【讨论】:

      【解决方案4】:

      当我尝试通过命令“gem install rake && bundle install”通过 gitlab ci/cd 管道推送到 repo 时,我解决了类似的问题

      【讨论】:

        【解决方案5】:

        就我而言,我的问题是环境问题。意思是,我在 bash 会话中做错了什么。在尝试了该线程中的几乎所有内容后,我打开了一个新的 bash 会话,一切都恢复正常了。

        【讨论】:

          【解决方案6】:

          **

          捆绑安装 --no-deployment

          **

          $ jekyll 帮助

          jekyll 4.0.0 -- Jekyll 是一个博客感知的 Ruby 静态站点生成器

          【讨论】:

            【解决方案7】:

            删除您的 Gemfile.lock。

            如果您使用的是 zsh,请移至 bash。

            sudo bash
            gem update --system 
            

            现在运行命令 bundle 来创建一个新的 Gemfile.lock 文件。 回到你的 zsh sudo exec zsh 现在运行你的 rake 命令。

            【讨论】:

              【解决方案8】:

              如果您遇到此问题,并尝试按照 this Jekyll documentation 运行 bundle exec jekyll serve,它会要求您运行 bundle install,这会提示您安装任何缺少的 gem,在这种情况下将是rake。这应该可以解决您的问题。

              您可能还需要运行 bundle update 以确保 Gemfile.lock 引用的是最新的 gem。

              【讨论】:

              • 用 Debain 8.2 和 jekyll 为我修复了它。
              【解决方案9】:

              我解决了删除 Gemfile.lock 的问题

              【讨论】:

              • 这是个坏建议,不要这样做。您的 Gemfile.lock 包含许多重要的版本限制,如果没有严格审查,不应在全球范围内消除这些限制。大多数人不会在他们的 Gemfile 中指定严格的版本,因此您最终可能会通过执行以下操作一次性更改许多 gem 的版本:baby -> bathwater。
              【解决方案10】:

              如果您想使用 bundler,我认为必须预先安装 rake。尝试通过“gem install”安装 rake,然后再次运行“bundle install”:

              gem install rake && bundle install
              

              如果您使用的是 rvm (http://rvm.io),则默认安装 rake...

              【讨论】:

              • Web 服务器用户是www-data,但安装了rbenvruby 的用户是deploy。所以我收到了一个宝石丢失的错误。将 Apache 与 mod_passenger 一起使用
              猜你喜欢
              • 2014-12-29
              • 2014-12-14
              • 2018-04-08
              • 2012-04-19
              • 2015-03-04
              • 2019-11-16
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多