2016-01-24 43 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

相关问题