2016-01-24 58 views
1

我想使用capistrano將我的rails應用程序部署到AWS,然後我完全按照原樣執行了教程。安裝net-ssh(3.0.2)時發生錯誤,並且Bundler無法繼續

這裏的教程:http://www.sitepoint.com/deploy-your-rails-app-to-aws/

然而,我的域名始終顯示502錯誤網關的nginx/1.4.6(Ubuntu的)。

事實上,每個i運行'帽生產部署的時間,我得到這個錯誤:

SSHKit::Runner::ExecuteError: Exception while executing as [email protected](my ip add): bundle exit status: 5 
bundle stdout: An error occurred while installing net-ssh (3.0.2), and Bundler cannot continue. 
Make sure that `gem install net-ssh -v '3.0.2'` succeeds before bundling. 
bundle stderr: Nothing written 

SSHKit::Command::Failed: bundle exit status: 5 
bundle stdout: An error occurred while installing net-ssh (3.0.2), and Bundler cannot continue. 
Make sure that `gem install net-ssh -v '3.0.2'` succeeds before bundling. 
bundle stderr: Nothing written 

Tasks: TOP => deploy:updated => bundler:install 
(See full trace by running task with --trace) 
The deploy has failed with an error: Exception while executing as [email protected]: bundle exit status: 5 
bundle stdout: An error occurred while installing net-ssh (3.0.2), and Bundler cannot continue. 
Make sure that `gem install net-ssh -v '3.0.2'` succeeds before bundling. 
bundle stderr: Nothing written 

我敢肯定,淨SSH寶石安裝成功了(本地和服務器端),使我不知道是什麼導致這個問題在這裏,希望有人在這裏可以幫助我。

在此先感謝!

UPDATE

我已經試過:sudo易於得到安裝Ruby淨SSH

我的Ubuntu服務器的寶石列表:

部署用戶:

*** LOCAL GEMS *** 

bigdecimal (1.2.6) 
bundler (1.8.4) 
bundler-unload (1.0.2) 
executable-hooks (1.3.2) 
gem-wrappers (1.2.7) 
io-console (0.4.3) 
jruby-pageant (1.1.1) 
json (1.8.1) 
minitest (5.4.3) 
net-ssh (3.0.2) 
pg (0.17.1) 
power_assert (0.2.2) 
psych (2.0.8) 
rake (10.4.2) 
rdoc (4.2.0) 
rubygems-bundler (1.4.4) 
rvm (1.11.3.9) 
test-unit (3.0.8) 

默認服務器的:

*** LOCAL GEMS *** 

bigdecimal (1.2.4) 
io-console (0.4.2) 
jruby-pageant (1.1.1) 
json (1.8.1) 
minitest (4.7.5) 
net-ssh (3.0.2) 
psych (2.0.5) 
rake (10.1.0) 
rdoc (4.1.0) 
test-unit (2.1.5.0) 

而且我仍然從運行上限生產部署中獲得與上述相同的錯誤。

有人救我:(

回答

1

今天早上遇到同樣的問題,不知道我們的解決方案是相同的,但這裏是我如何固定它。

我正在薄荷17(Ubuntu的14.04),這安裝Ruby包時,讓我的Ruby 1.9.3。

首先我遇到net-ssh requires Ruby version >= 2.0讓我從另一個來源,然後捆綁安裝了Ruby 2.2的誤差。

一直得到了同樣的錯誤,你即使我手動安裝net-ssh 3.0.2手動就好了。

原來的bundler仍然引用了一些導致問題的Ruby 1.9.1庫路徑。

要解決它,我跑到下面的命令:

sudo apt-get remove ruby ruby1.9.1 bundler 
sudo apt-get autoremove # to clean up removed Ruby packages 
sudo gem install bundler 

然後,我能夠運行bundler install並沒有得到錯誤。

希望有所幫助。

+0

不適合我,我已經放棄並決定使用彈性豆莖,但謝謝!當我有空時,我一定會再試一次。 – ttinggggg

相關問題