0
我試圖通過Capistrano從本地計算機部署到我的部署服務器。當我部署時,它連接到服務器,然後丟棄以下信息。Rails 4 Capistrano部署無法找到有效的支持
** sftp upload /var/folders/x0/hyzt7pms0599ymtyjft739kw0000gn/T/20160406223514.tar.gz -> /tmp/20160406223514.tar.gz
[address] /tmp/20160406223514.tar.gz
[address] done
* sftp upload complete
* executing "cd /var/www/address/releases && tar xzf /tmp/20160406223514.tar.gz && rm /tmp/20160406223514.tar.gz"
servers: ["address"]
[address] executing command
command finished in 519ms
* 2016-04-06 18:35:59 executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* 2016-04-06 18:35:59 executing `deploy:assets:symlink'
* executing "rm -rf /var/www/address/releases/20160406223514/public/assets && mkdir -p /var/www/address/releases/20160406223514/public && mkdir -p /var/www/address/shared/assets && ln -s /var/www/address/shared/assets /var/www/address/releases/20160406223514/public/assets"
servers: ["server"]
[server] executing command
command finished in 48ms
* executing "chmod -R -- g+w /var/www/address/releases/20160406223514 && rm -rf -- /var/www/address/releases/20160406223514/public/system && mkdir -p -- /var/www/address/releases/20160406223514/public/ && ln -s -- /var/www/address/shared/system /var/www/address/releases/20160406223514/public/system && rm -rf -- /var/www/address/releases/20160406223514/log && ln -s -- /var/www/address/shared/log /var/www/address/releases/20160406223514/log && rm -rf -- /var/www/address/releases/20160406223514/tmp/pids && mkdir -p -- /var/www/address/releases/20160406223514/tmp/ && ln -s -- /var/www/address/shared/pids /var/www/address/releases/20160406223514/tmp/pids"
servers: ["address"]
[address] executing command
command finished in 49ms
triggering after callbacks for `deploy:update_code'
* 2016-04-06 18:35:59 executing `deploy:assets:precompile'
triggering before callbacks for `deploy:assets:precompile'
* 2016-04-06 18:35:59 executing `deploy:assets:update_asset_mtimes'
* executing "[ -e '/var/www/address/shared/assets/.sprockets-manifest*' ] && cat /var/www/address/shared/assets/.sprockets-manifest* || echo"
servers: ["address"]
[server] executing command
command finished in 31ms
* executing "cd -- /var/www/address/releases/20160406223514 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile"
servers: ["address"]
[address] executing command
** [out :: address] Could not find activesupport-4.2.0 in any of the sources
** [out :: address] Run `bundle install` to install missing gems.
command finished in 547ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/address/releases/20160406223514; true"
servers: ["address"]
[address] executing command
command finished in 57ms
failed: "sh -c 'cd -- /var/www/address/releases/20160406223514 && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile'" on address
它說,它無法找到的ActiveSupport,但是當我在服務器上運行的寶石列表,它列出,並顯示版本4.2.6,4.2.4,4.2.0。
這是一個權限問題?
這裏是deploy.rb
set :application, "app"
set :repository, "repo"
set :deploy_to, '/var/www/address'
set :scm, :git
set :branch, "master"
set :user, "user"
set :use_sudo, false
set :rails_env, "production"
set :deploy_via, :copy
set :keep_releases, 5
default_run_options[:pty] = true
server "address", :app, :web, :db, :primary => true
namespace :deploy do
desc "Symlink shared config files"
task :symlink_config_files do
run "#{ try_sudo } ln -s #{ deploy_to }/shared/config/database.yml #{ current_path }/config/database.yml"
end
desc "Restart Passenger app"
task :restart do
run "#{ try_sudo } touch #{ File.join(current_path, 'tmp', 'restart.txt') }"
end
end
after "deploy", "deploy:symlink_config_files"
after "deploy", "deploy:restart"
after "deploy", "deploy:cleanup"
這是我第一次部署到此服務器。我將把我的deploy.rb中的代碼添加到上面的帖子中。 「捆綁安裝」應該在該文件中?我不知道如何在服務器上運行bundle安裝之前,你能告訴我更多嗎? – lostrennie
看到我上面的編輯。 – born4new
我正在運行Capistrano 2.15.7,並且此要求不起作用。有沒有辦法與舊版本做到這一點? – lostrennie