【问题标题】:Could not find capistrano-2.13.3 in any of the sources在任何来源中都找不到 capistrano-2.13.3
【发布时间】:2014-10-08 07:57:13
【问题描述】:

我使用http://jaysonrowe.blogspot.com/2012/04/installing-ruby-and-rails-on-fedora.html 在 Rails 环境中设置 ruby​​。我安装了mysql 5.5。现在,当我从 bitbucket 克隆一个项目并运行 bundle install 时,我收到以下错误:

[xyz@xyz ruby_repo]$ bundle install
Fetching gem metadata from http://rubygems.org/......
Fetching gem metadata from http://rubygems.org/..
Could not find capistrano-2.13.3 in any of the sources

当我在 ruby​​_repo 目录中执行 rails -v 时,出现以下错误:

[xyz@xyz ruby_repo]$  rails -v
Could not find abstract-1.0.0 in any of the sources
Run `bundle install` to install missing gems.

以下是我的 Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.10'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'rmagick'
gem "will_paginate", "~> 3.0.pre2"
gem 'mysql2','0.2.7'
gem "nokogiri"
gem 'activemerchant', :require => 'active_merchant'
gem "webrobots", "~> 0.0.10"
gem 'mixpanel'
gem 'thinking-sphinx', '2.0.10'
gem 'whenever', :require => false
gem 'json'
gem 'vimeo'
gem "koala"
gem 'typhoeus'
gem 'delayed_job_active_record'
gem "delayed_job"
gem 'mini_fb'
gem 'daemons'
gem 'annotate'
gem 'capistrano'
gem 'rvm-capistrano'
gem 'grosser-ssl_requirement', :require => 'ssl_requirement'
gem 'acts-as-taggable-on'
gem 'capistrano'
gem 'rvm-capistrano'
# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
#gem 'capistrano'
#gem 'capistrano-ext'
#To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'


# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

当我执行 gem list 时,我得到以下输出

*** LOCAL GEMS ***

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activeresource (3.2.8)
activesupport (3.2.8)
arel (3.0.2)
builder (3.0.4)
bundler (1.2.1)
capistrano (2.13.4)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0)
erubis (2.7.0)
execjs (1.4.0)
highline (1.6.15)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.3)
json (1.7.5)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
mysql2 (0.3.11)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.1)
net-ssh-gateway (1.1.0)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.2)
rails (3.2.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
sass (3.2.1)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.11)
tzinfo (0.3.33)
uglifier (1.3.0)

但是,当我创建一个全新的项目时,我不会遇到任何此类问题。谁能告诉我可能是什么问题?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3


    【解决方案1】:

    此版本已从 ruby​​gems.org 中删除。通过这种方式运行 bundle update 来更新 capistrano:

    bundle update capistrano
    

    这样您只需将 capistrano 更新到当前版本。如果你删除 Gemfile.lock 并运行 bundle,你所有的 gem 版本都会被更新,这通常不是你想要的。

    【讨论】:

    • 如果您有很多没有指定版本的 gem,这是更安全的方法。如果您删除 Gemfile.lock,它将安装未锁定到 Gemfile 中的版本的每个 gem 的最新版本。运行 bundle update capistrano 只会更新 capistrano。
    • 有谁知道为什么 2.13.4 从 ruby​​gems 中删除?真的存在严重的安全问题吗?
    • 感谢 Fa11enAngel,我查看了从现在到 9 月之间的所有提交消息,没有什么特别突出的。从 ruby​​gems.org 删除版本的行为不一定会导致 git commit 消息。您是否有特定的提交信息?你还记得它是关于什么的吗,或者你能提供一个链接吗?
    • 对不起。我没有检查提交,因为更新 capistrano 没有问题。
    【解决方案2】:

    删除 Gemfile.lock 的内容或文件本身。

    【讨论】:

    • 我遇到了同样的问题(在任何来源中都找不到 capistrano-2.13.3)。看来
    • ... 这个问题可以通过这种方式轻松解决。 Gemfle.lock 是由 Bundler 管理的 gem 依赖的快照。如果您在删除文件后运行“捆绑安装”,则会创建一个没有任何过时引用的新快照。更多信息:gembundler.com/rationale.html.
    • 可能是什么问题?这个文件被其他人使用没有任何问题?就没有别的办法了吗?
    • 它帮助我解决了这个问题。但我不确定这是否是正确的方法......
    • 您不应该删除您的 Gemfile.lock。如果您只想要当前版本的 capistrano,您应该按照 Fa11enAngel 的建议运行 bundle update capistrano。 .lock 文件的目的是让您决定何时更新哪个 gem。当您删除整个文件时,您将获得每个 gem 的最新版本。这可能会导致东西破裂,并且比仅仅更新 capistrano 更加繁重。话虽如此,你应该定期更新所有的 gem,但是通过运行 bundle update 来做到这一点。
    【解决方案3】:

    我只是想出了问题。麻烦制造者是rvm。 我为我的应用程序创建了一个 gemset,并在这个 gemset 中运行 bundle。 但是,由于某种原因,当我运行 rails c 或 bundle exec rails c 时,它仍然会在全局 gemset 中查找它需要的 gem。

    所以在我转到全局 gemset 并安装所有 gem 之后,它就可以工作了。不确定是单独的 rvm gemset 问题,还是 bundle + rvm gemset 的组合。

    【讨论】:

      猜你喜欢
      • 2012-03-12
      • 2017-01-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-01
      相关资源
      最近更新 更多