2012-02-25 71 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

相關問題