heroku에 3.2 레일 앱이 있습니다. 나는 javascript가 프로덕션 모드에서로드되지 않는다는 사실을 해결하기 위해 찾을 수있는 모든 것을 시도했다. dev에 잘 작동합니다. 또한 heroku에 배포 할 때 프리 컴파일이 실패합니다. 그러나 prod에서 소스 코드를 보면 javascripts 파일 (/assets/application-32fdbd115c5d59c7be2876c103063600.js)이로드되고 내용이 있음을 분명히 알 수 있습니다.프로덕션 환경에서 자산 파이프 라인이 작동하지 않습니다. 시도했습니다.
나는 생각하고 읽을 수있는 모든 설정을 시도했다. 나는 무엇을해야할지 잘 모릅니다. 여기 내 설치가 production.rb 현재의 :
config.cache_classes = true
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_assets = false
config.assets.compress = false
config.assets.compile = true
config.assets.digest = true
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
와 environment.rb에의
:# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
App::Application.initialize!
application.rb :
require File.expand_path('../boot', __FILE__)
require "rails/all"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end
module App
class Application < Rails::Application
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
# Enable escaping HTML in JSON.
config.active_support.escape_html_entities_in_json = true
config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
내 gemfile :
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'mysql2'
gem 'thin'
gem 'activerecord-postgresql-adapter'
gem 'devise'
gem 'paperclip', '~> 3.0'
gem 'haml'
gem 'activeadmin'
gem "meta_search", '>= 1.1.0.pre'
gem 'aws-sdk', '~> 1.3.4'
gem 'acts_as_list'
gem 'stripe'
gem 'sass-rails', '~> 3.2.3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'coffee-rails', '~> 3.2.1'
gem 'twitter-bootstrap-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :development do
gem 'debugger'
end
아무 것도 작동하지 않는 것 같습니다. 내 로컬 컴퓨터 또는 heroku에서 생산 모드로. 그러나, 그것은 개발에 잘 작동합니다. 생산 상자에서
Heroku를 다시 시작해 보셨습니까? 'heroku restart' –
그래, 그게 아무것도 안했어 –