2013-03-22 83 views
0

我想部署我的第一個應用到VPS Ubuntu 10.10,使用capsitrano,並遵循RailsCasts「部署到VPS」視頻廣播。部署第一個應用到VPS,掙扎着與capistrano

還有一個問題,我沒有添加nginx配置,也沒有獨角獸配置文件​​。我可以沒有他們去嗎? (我將要配置nginx的低谷控制檯)。

我deploy.rb文件

require "bundler/capistrano" 

set :application, "picurwebaruhaz" 

set :scm, "git" 
set :repository, "git://github.com/gwuix2/picurwebaruhaz.git" 
set :branch, "master" 
set :user, "gwuix2" 
set :deploy_to, "/home/#{user}/#{application}" 

default_run_options[:pty] = true 

# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names 
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` 

role :web, "198.211.117.84"       # Your HTTP server, Apache/etc 
role :app, "198.211.117.84"       # This may be the same as your `Web` server 
role :db, "198.211.117.84", :primary => true # This is where Rails migrations will run 
role :db, "198.211.117.84" 

# if you want to clean up old releases on each deploy uncomment this: 
after "deploy:restart", "deploy:cleanup" 

# if you're still using the script/reaper helper you will need 
# these http://github.com/rails/irs_process_scripts 

# If you are using Passenger mod_rails uncomment this: 
namespace :deploy do 
    task :start do ; end 
    task :stop do ; end 
    task :restart, :roles => :app, :except => { :no_release => true } do 
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
end 

我得到以下錯誤:

* executing "cd /home/gwuix2/picurwebaruhaz/releases/20130322113243 && bundle install --gemfile /home/gwuix2/picurwebaruhaz/releases/20130322113243/Gemfile --path /home/gwuix2/picurwebaruhaz/shared/bundle --deployment --quiet --without development test" 
    servers: ["198.211.117.84"] 
    [198.211.117.84] executing command 
** [out :: 198.211.117.84] sh: 1: bundle: not found 
    command finished in 357ms 
*** [deploy:update_code] rolling back 
    * executing "rm -rf /home/gwuix2/picurwebaruhaz/releases/20130322113243; true" 
    servers: ["198.211.117.84"] 
    [198.211.117.84] executing command 
    command finished in 384ms 
failed: "sh -c 'cd /home/gwuix2/picurwebaruhaz/releases/20130322113243 && bundle install --gemfile /home/gwuix2/picurwebaruhaz/releases/20130322113243/Gemfile --path /home/gwuix2/picurwebaruhaz/shared/bundle --deployment --quiet --without development test'" on 198.211.117.84 

編輯:

這裏是我的應用程序: APP ON GITHUB https://github.com/gwuix2/picurwebaruhaz

Edit_2: 如果我SSH到服務器並運行$ gem包捆綁,它安裝,但是當我運行:

[email protected]:~$ sudo gem install bundler sudo: gem: command not 
found 

有什麼建議?

自己弄不明白。

+0

您似乎沒有安裝在服務器上捆綁的寶石。 SSH到服務器並運行'gem install bundler'並重試。 – 2013-03-22 11:48:59

+0

發生同樣的錯誤 – 2013-03-22 11:51:21

+0

我正在考慮像我需要做些事情可執行的事情,也許? – 2013-03-22 11:52:17

回答

0

deploy.rb需要:

require "rvm/capistrano" 
require "bundler/capistrano" 
0

嘗試沒有sudo運行捆綁命令:

[email protected]:~$ gem install bundler sudo: gem: command not found 
+0

thx,但問題被解決與要求「rvm/capistrano」;) – 2013-03-22 14:08:36