0

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.

One more question, i haven't added an nginx config, nor a unicorn config file. Can i go without them? ( I will want to config nginx trough console.)

My deploy.rb file

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

Edit_2: If I SSH into the server and run $ gem install bundler, it installs, but when I run:

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

any suggestions?

Can't figure it out myself.

j0k
  • 22,600
  • 28
  • 79
  • 90
Barna Kovacs
  • 1,226
  • 1
  • 14
  • 35
  • You don't appear to have the bundler gem installed on the server. SSH into the server and run `gem install bundler` and try again. – Robin Fisher Mar 22 '13 at 11:48
  • I'm thinking about something like i need to make something executeable, maybe? – Barna Kovacs Mar 22 '13 at 11:52
  • if i ssh in, i find all the directories empty, shared, system, releases, empty – Barna Kovacs Mar 22 '13 at 11:54
  • Are you using RVM? If so, you need to add `require "rvm/capistrano"` at the top of your deploy.rb. If not, it sounds like bundler isn't in your path. [This might help](http://stackoverflow.com/questions/5541721/capistrano-bundle-not-found-error-during-deployment) – Robin Fisher Mar 22 '13 at 11:54
  • cd /home/gwuix2/picurwebaruhaz/releases/20130322115511 -bash: cd: /home/gwuix2/picurwebaruhaz/releases/20130322115511: No such file or directory – Barna Kovacs Mar 22 '13 at 11:56
  • require rvm throws error, i have rvm on VPS, but no rvm on local machine, from where i run cap:deploy – Barna Kovacs Mar 22 '13 at 11:59
  • cap deploy:check returns: You appear to have all necessary dependencies installed – Barna Kovacs Mar 22 '13 at 12:06
  • answer was here: [http://stackoverflow.com/questions/5541721/capistrano-bundle-not-found-error-during-deployment][1] [1]: http://stackoverflow.com/questions/5541721/capistrano-bundle-not-found-error-during-deployment – Barna Kovacs Mar 22 '13 at 13:06

2 Answers2

0

deploy.rb needs:

require "rvm/capistrano"
require "bundler/capistrano"
Barna Kovacs
  • 1,226
  • 1
  • 14
  • 35
0

Try running bundler command without sudo:

gwuix2@picurbolt:~$ gem install bundler sudo: gem: command not found
Catfish
  • 18,876
  • 54
  • 209
  • 353