简体   繁体   English

在Capistrano上苦苦挣扎地将第一个应用程序部署到VPS

[英]Deploying first app to VPS, struggling with capistrano

I'm trying to deploy my first app to a VPS ubuntu 12.10, using capsitrano, and following the RailsCasts "Deploying to a VPS" videocast. 我正在尝试使用capsitrano将我的第一个应用程序部署到VPS ubuntu 12.10,并遵循RailsCasts的“部署到VPS”视频广播。

One more question, i haven't added an nginx config, nor a unicorn config file. 还有一个问题,我没有添加nginx配置,也没有独角兽配置文件​​。 Can i go without them? 我可以没有他们吗? ( I will want to config nginx trough console.) (我将要配置nginx槽控制台。)

My deploy.rb file 我的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

I get the following error: 我收到以下错误:

  * 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

Edit: 编辑:

Here is my app: APP ON GITHUB https://github.com/gwuix2/picurwebaruhaz 这是我的应用程序: GITHUB上的APP https://github.com/gwuix2/picurwebaruhaz

Edit_2: If I SSH into the server and run $ gem install bundler, it installs, but when I run: Edit_2:如果我通过SSH进入服务器并运行$ gem install bundler,它将安装,但是在我运行时:

 gwuix2@picurbolt:~$ sudo gem install bundler sudo: gem: command not
 found

any suggestions? 有什么建议么?

Can't figure it out myself. 我自己想不通。

deploy.rb needs: deploy.rb需要:

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

尝试在不使用sudo的情况下运行bundler命令:

gwuix2@picurbolt:~$ gem install bundler sudo: gem: command not found

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM