我已禁用管道资产预编译。为此,我在我的config/environments/development.rb配置/配置中有下面一行
config.assets.enabled = false我正在尝试使用Capistrano3在开发环境中进行部署。当我运行部署命令时,我发现资产是预编译的。
$cap开发部署--跟踪
DEBUG [8b4a938e] Command: cd /home/ec2-user/capistrano-3/a/releases/20140122054901 && ( RAILS_ENV=development ~/.rvm/bin/rvm 2.0.0-p353 do bundle exec rake assets:precompile )
DEBUG [8b4a938e] /home/ec2-user/.rvm/rubies/ruby-2.0.0-p353/bin/ruby /home/ec2-user/capistrano-3/ano_dev/shared/bundle/ruby/2.0.0/bin/rake assets:precompile:all RAILS_ENV=development RAILS_GROUPS=assets
DEBUG [8b4a938e]
INFO [8b4a938e] Finished in 8.812 seconds with exit status 0 (successful).我还需要做些什么来避免预先编译资产。它进一步给出
发布于 2014-01-22 08:02:49
你的档案里有什么?
如果你有
require 'capistrano/rails'然后它将预编译您的资产,因为capistrano/rails还包括bundler、rails/assets和rails/迁移。
https://github.com/capistrano/rails/blob/master/lib/capistrano/rails.rb https://github.com/capistrano/rails/blob/master/lib/capistrano/tasks/assets.rake
如果您仍然希望使用bundler和迁移,但不想使用资产,则可以将它们单独包含在Capfile中,只需确保不再需要'capistrano/rails':
require 'capistrano/bundler'
require 'capistrano/rails/migrations'发布于 2017-05-26 18:03:52
就我的情况而言,我们的团队为所有的Rails应用程序使用一个共享的gem,而共享的gem需要'capistrano/rails‘(因此引入了资产编译)。对于没有处理这个问题的应用程序,我们所做的只是添加:
set :assets_roles, []在config/deploy.rb中,这使得capistrano rails跳过了资产预编译。
https://stackoverflow.com/questions/21276934
复制相似问题