2012-02-25 69 views
1

捆扎机版本1.0.22为什么Bundler报告“无法在任何来源中找到capistrano-2.11.1”?

部署到RedHat Linux上6

红宝石1.9.3p0

的Rails 3.2.1


我读的捆扎机文档并采取这些步骤.. 。

  • 在dev上设置了一切工作站,所以所有的宝石安装和应用程序的工作和测试通过。

  • 检查了GemfileGemfile.lock进入源控制。确保不要检查.bundle进入源代码管理。

我跑$ cap deploy。现在我的代码在生产服务器上。

继在docs的指示,我登录时,cd到我的应用程序根目录,并运行...

$ bundle install --development 

这是结果...

$ bundle install --deployment 
Fetching source index for https://rubygems.org/ 
Could not find capistrano-2.11.1 in any of the sources 

没有人有任何想法为什么这个错误发生?

任何想法如何说服Bundler安装我所需的宝石?

我试图找到从什么捆扎机认为是创业板环境中的线索......

$ bundle exec gem environment 
Could not find rake-0.9.2.2 in any of the sources 

我看着捆扎机排查页面,按照说明有删除了一堆东西...

# remove user-specific gems and git repos 
rm -rf ~/.bundle/ ~/.gem/ 

# remove system-wide git repos and git checkouts 
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/ 

# remove project-specific settings and git repos 
rm -rf .bundle/ 

# remove project-specific cached .gem files 
rm -rf vendor/cache/ 

# remove the saved resolve of the Gemfile 
# 
# For now, did not delete this. If I understand the Bundler docs correctly, 
# this file is sort of the whole point of Bundler. If I delete it, my deployed 
# dependencies won't be the same as in development. 
# rm -rf Gemfile.lock 

# try to install one more time 
bundle install 

捆扎机还称...

$ bundle install --deployment 
Fetching source index for https://rubygems.org/ 
Could not find capistrano-2.11.1 in any of the sources 

OK,挺好的。我将删除Gemfile.lock ...

$ bundle install --deployment 
The --deployment flag requires a Gemfile.lock. Please make sure you have checked 
    your Gemfile.lock into version control before deploying. 

我将不胜感激任何帮助。

回答

0

该版本的Capistrano被抽出,不再从rubygems.org上可用。你可以看到在版本页面https://rubygems.org/gems/capistrano/versions

+0

rake-0.9.2.2怎么样?据我所知,这还没有被抽出。你有没有想过为什么Bundler总体上不能像我的系统上宣​​传的那样运作。 – Ethan 2012-02-25 00:45:09

+0

说实话,我做到了这一点,我意识到你正在使用一个被抽出并且没有进一步阅读的Capistrano版本。这可能是一个不完整的捆绑安装。恢复您的Gemfile.lock删除并更新Capistrano的版本。如果在Gemfile中没有指定准确的版本,那么运行'bundle update capistrano'。如果是,那么只需将其更改为下一个可用版本。 – 2012-02-25 01:16:52

+0

好的,完成了。你是对的。 'bundle install --development'能够继续下去。 (直到遇到nokogiri并且因此而ch咽,但那是另一个问题) – Ethan 2012-02-25 01:27:42

1

在这里有一个类似的rake-0.9.2.2错误。发现我忽略了适当的require,以便在我的deploy.rb文件中包含打包程序特定的capistrano任务:

在您的部署中。RB:

require 'bundler/capistrano' 
require 'delayed/recipes' 

这结束了运行bundle install你(有一些不错的命令行参数)。

另外,您的应用程序服务器上不需要capistrano。你可以让捆绑知道,在Gemfile像这样:

group :development do 
    gem 'capistrano' 
end 
cap deploy

现在,帽告诉打捆忽略了developmenttest组,对造成不安装Capistrano的(和其他开发或测试工具)生产服务器。

+0

是的!在开发中不需要capistrano,这对我来说是最好的解决方案,并为我工作。 – FireDragon 2013-05-07 21:04:56

相关问题