capistrano使用jruby部署

时间:2013-09-11 15:01:02

标签: deployment rake rvm capistrano jruby

我有一个拥有多个rails应用程序的服务器,其中大多数都是ruby,还有一个我们使用jruby的应用程序

在乘客下部署后,我总是遇到此错误:

Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)

但是,当我使用WEBrick

进行本地导航时,我不会这样做

部署脚本如下:

#server details
default_run_options[:pty] = true
set :user, "xxxxx"
set :scm_passphrase, "yyyyyy"
set :domain, "abc.abc.com"
set :application, "project_adsadsa"

#file path
set :repository,  "git@github.com:jjjjjjjj/aaaaaaaa.git"
set :deploy_to, "/var/www/html/jdbc"

# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

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

#miscellaneous options
set :rails_env, :development
set :deploy_via, :remote_cache
set :scm, 'git'
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, false
ssh_options[:forward_agent] = true

namespace :deploy do
  desc "cause Passenger to initiate a restart"
  task :restart do
    run "touch #{current_path}/tmp/restart.txt"
  end

end

after "deploy:update_code", :bundle_install
after "deploy", :create_symlink

desc "do symlink the db"
task :create_symlink, :roles => :app do
  run "ln -s #{shared_path}/development.sqlite3 #{current_path}/db/development.sqlite3"
end

desc "install the necessary prerequisites"
task :bundle_install, :roles => :app do
  run "cd #{release_path} && bundle install --without production"
end

0 个答案:

没有答案