2016-01-24 84 views
0

我想使用Capistrano的應用部署我的導軌AWS和我也跟着教程,正是因爲它是應用AWS(Ubuntu服務器)。部署導軌使用Capistrano的

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

然而,我的網站始終顯示,無論多少次,我刷新或運行「帽生產部署」 nginx的默認頁面。

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

DEBUG [81457789] An error occurred while installing pg (0.17.1), and 

Bundler cannot continue. 
DEBUG [81457789]  
DEBUG [81457789] Make sure that `gem install pg -v '0.17.1'` succeeds before bundling. 
DEBUG [81457789]  
(Backtrace restricted to imported tasks) 
cap aborted! 
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: bundle exit status: 5 
bundle stdout: An error occurred while installing pg (0.17.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling. 
bundle stderr: Nothing written 

SSHKit::Command::Failed: bundle exit status: 5 
bundle stdout: An error occurred while installing pg (0.17.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.17.1'` 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 pg (0.17.1), and Bundler cannot continue. 
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling. 
bundle stderr: Nothing written 

的Gemfile:

source 'https://rubygems.org' 

gem 'rails',     '4.2.2' 
gem 'bcrypt',     '3.1.7' 
gem 'faker',     '1.4.2' 
gem 'carrierwave',    '0.10.0' 
gem 'mini_magick',    '3.8.0' 
gem 'fog',      '1.36.0' 
gem 'will_paginate',   '3.0.7' 
gem 'bootstrap-will_paginate', '0.0.10' 
gem 'bootstrap-sass',   '3.2.0.0' 
gem 'sass-rails',    '5.0.2' 
gem 'uglifier',    '2.5.3' 
gem 'coffee-rails',   '4.1.0' 
gem 'jquery-rails',   '4.0.3' 
gem 'turbolinks',    '2.3.0' 
gem 'jbuilder',    '2.2.3' 
gem 'sdoc',     '0.4.0', group: :doc 
gem 'figaro' 
gem 'puma' 
gem 'capistrano-ssh-doctor', '~> 1.0' 
gem 'pg',    '0.17.1' 

group :development, :test do 
    gem 'sqlite3',  '1.3.9' 
    gem 'byebug',  '3.4.0' 
    gem 'web-console', '2.0.0.beta3' 
    gem 'spring',  '1.1.3' 
    gem 'capistrano', '3.4.0' 
    gem 'capistrano-rails', '~> 1.1', require: false 
    gem 'capistrano3-puma' 
    gem 'capistrano-bundler', require: false 
    gem 'capistrano-rvm' 
end 

group :test do 
    gem 'minitest-reporters', '1.0.5' 
    gem 'mini_backtrace',  '0.1.3' 
    gem 'guard-minitest',  '2.3.1' 
end 

group :production do 
    gem 'rails_12factor', '0.0.2' 
end 

我非常肯定 '創業板安裝PG -v' 0.17 .1「成功了。我甚至卸載並安裝說服自己。

我不知道這個問題是從「帽生產部署」或問題比這更深。

它的我第一次事先就我自己的部署web應用的服務器,我還沒有完全瞭解如何部署和服務器的工作原理,希望有人能幫助我在這裏,謝謝!

+0

可以嘗試從AWS服務器上運行此命令:'sudo apt-get install libgmp3-dev',然後執行'gem install pg' – Abhinay

+0

嗨Abhinary,感謝您的評論,我剛剛嘗試過。不幸的是,我仍然有同樣的錯誤。 – ttinggggg

+0

如果我說我的網絡應用程序非常簡單,它沒有數據庫,它有幫助嗎? – ttinggggg

回答

0

要編譯Ruby中,你需要在你的服務器上安裝libpq-dev組件PG的驅動程序。

0

沒有最佳答案,但不知它的工作原理。

我放棄了,我決定終止我的AWS實例和重做,但是,我仍然有相同的錯誤每題但使用上述評論阿希奈的建議現在的作品。

「考慮檢查出這個問題stackoverflow.com/questions/20754081/...和相關答案大概是這樣的一個:stackoverflow.com/a/20754173/2545197」