Hello,
I''m currently trying to figure out how to do a proper Capistrano
deploy from my system to the server that needs to be hosting my Ruby
on Rails application. A small caveat that I had to tackle first was
getting the source code over without the use of git or svn. After
searching a bit, I found that Capistrano was able to ftp the stuff
over through the shell, so that''s working currently.
The problems I''m encountering however, is that I cannot start up my
Thin server cluster after a deploy because bundler keeps telling me
that it cannot locate the GemFile for starting up Thin.
Another issue I seem to be encountering is the migrations not running
after a deploy for some reason.
Below is my deploy.rb file which is sitting in the /config folder of
my Ruby on Rails application:
require "bundler/capistrano"
default_run_options[:pty] = true
# define the application and Version Control settings
set :application, "ESCO Matching Demo"
set :repository, "svn://192.168.33.70/RubyOnRails/ESCO"
set :deploy_via, :copy
set :user, "kurt"
set :deploy_to, "/var/www/apps"
# Tell Capistrano the servers it can play with
server "85.255.206.157", :app, :web, :db, :primary => true
# Generate an additional task to fire up the thin clusters
namespace :deploy do
desc "Start the Thin processes"
task :start do
run <<-CMD
cd /var/www/apps/current; bundle exec thin start -C config/
thin.yml
CMD
end
desc "Stop the Thin processes"
task :stop do
run <<-CMD
cd /var/www/apps/current; bundle exec thin stop -C config/
thin.yml
CMD
end
desc "Restart the Thin processes"
task :restart do
run <<-CMD
cd /var/www/apps/current; bundle exec thin restart -C config/
thin.yml
CMD
end
desc "Create a symlink from the public/cvs folder to the shared/
system/cvs folder"
task :update_cv_assets, :except => {:no_release => true} do
sudo "ln -s /var/www/shared/cvs /var/www/apps/current/public/cvs"
end
end
# Define all the tasks that need to be running manually after
Capistrano is finished.
after "deploy:finalize_update", "deploy:update_cv_assets"
after "deploy", "deploy:migrate"
I think everything to perform a deloy wiht Capistrano should be
inside the file. If anything is missing, please let me know so i can
make adjustments to it. I''m pretty new to this Capistrano stuff, so
I''ll probably have some errors here and there. As mentioned above,
pushing over the files seems to work without problems as the source
gets updated and refreshing the site after a deploy shows the new
page.
However after a cap deploy command, when Capistrano tries to run the
restart task on thin, it complains about the gemFile not beeing found
and the tasts are aborted and no subsequent tasks are performed. Some
people said to check gem_home etc, when echoing them on the server
they''re defined and return the correct path to my gems etc.
Another issue is that I can''t seem to start up the Thin clusters
anymore after the recent deploy. It complains either about missing
pids or it only starts up a single thin instance instead of the
cluster. Below is the yaml file containing the config of my cluster:
---
pid: tmp/pids/thin.pid
address: 0.0.0.0
timeout: 30
wait: 30
port: 4000
log: log/thin.log
max_conns: 1024
require: []
environment: production
max_persistent_conns: 512
server: 4
daemonize: true
chdir: /var/www/apps/current
If there''s anything else I need to supply for more information,
I''ll
do so.
I already have a similar post like this on stackoverlow :
http://stackoverflow.com/questions/6018591/capistrano-deploy-with-thin-servers
I really hope someone can help me out with this, because it''s driving
me nuts....
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.