我正在尝试使用以下教程将rails应用程序部署到heroku:
https://devcenter.heroku.com/articles/getting-started-with-rails4
因此,我使用rails 4.1.1和ruby 2.1.1
我的Gemfile里面有gem 'rails_12factor', group: :production
。
我的application.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
module Charticus
class Application Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
我创建了文件
public/assets/manifest.yml
但是,当我将应用程序部署到heroku时-它会将我所有的js文件文件编译到application.js和所有css文件application.css中。而且我无法使用firebug在app.heroku.com上看到它。
我需要如何进行配置才能在app.heroku.com上查看我的所有js和css文件?
如何在Heroku上禁用 Assets 预编译和最小化?
请帮帮我!
谢谢
最佳答案
lib/tasks/assets.rake
Rake::Task["assets:precompile"].clear
namespace :assets do
task 'precompile' do
puts "Not pre-compiling assets..."
end
end
大功告成
关于heroku - 如何在heroku上禁用 Assets 编译?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23687972/