gpt4 book ai didi

deployment - Capistrano 编译 Assets 错误 - Assets :precompile:nondigest?

转载 作者:行者123 更新时间:2023-12-04 06:44:31 26 4
gpt4 key购买 nike

我的应用程序似乎部署正确,但我收到此错误:

      * executing "cd /home/deploy/tomahawk/releases/20120208222225 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["ip_address"]
[ip_address] executing command
*** [err :: ip_address] /opt/ruby/bin/ruby /opt/ruby/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets

我在这里尝试过尝试编译 Assets 的解决方案: http://lassebunk.dk/2011/09/03/getting-your-assets-to-work-when-upgrading-to-rails-3-1/

在这里: http://railsmonkey.net/2011/08/deploying-rails-3-1-applications-with-capistrano/

在这里: http://dev.af83.com/2011/09/30/capistrano-rails-3-1-assets-can-be-tricky.html

这是我的 deploy.rb :
require "bundler/capistrano"
load 'deploy/assets'

set :default_environment, {
'PATH' => "/opt/ruby/bin/:$PATH"
}

set :application, "tomahawk"
set :repository, "repo_goes_here"
set :deploy_to, "/home/deploy/#{application}"
set :rails_env, 'production'
set :branch, "master"

set :scm, :git
set :user, "deploy"
set :runner, "deploy"
set :use_sudo, true

role :web, "my_ip"
role :app, "my_ip"
role :db, "my_ip", :primary => true

set :normalize_asset_timestamps, false
after "deploy", "deploy:cleanup"

namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end

[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :domain do ; end
end
end

task :after_update_code do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end

最佳答案

首先不要忘记在下面添加 gem

group :production do
gem 'therubyracer'
gem 'execjs'
end

然后在你的 cap 文件中,在你的 after_update_code 中添加这一行
run "cd #{release_path}; rake assets:precompile RAILS_ENV=production "

这对我来说很好;)

干杯,

格雷戈里·霍利恩

关于deployment - Capistrano 编译 Assets 错误 - Assets :precompile:nondigest?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9202675/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com