我已经改完 production.rb, application.rb,清理 assets,生产状态 precomplie。可是 js,css 还是没有显示出来。不知道为什么
config.cache_classes = true
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
#config.serve_static_files = true
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config.log_level = :debug
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
config.assets.enabled = true
config.assets.prefix = "/assets"
config.active_record.raise_in_transactional_callbacks = true
Rails.application.config.assets.precompile += %w( jquery.flexslider.js shCore.js imagesloaded.min.js isotope.js modernizr.custom.js prettify.js toucheffects.js XRegExp.js wow.min.js font-awesome.min.css)
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="">
<meta name="description" content="">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<script type="text/javascript" href="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" href="https://maps.gstatic.com/maps-api-v3/api/js/21/9a/intl/zh_cn/main.js"></script>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body class="home">
<%= render 'layouts/nav' %>
<div class="site-main">
<%= yield %>
</div>
<%= render 'layouts/footer' %>
</body>
</html>
这个页面里加载一个 google 地图的 js 不知道为什么也不能用了。 Gem 里已经加了 rails_12factor,uglifier,sass-rails
rake assets:clobber
RAILS_ENV=production bundle exec rake assets:clean
rake assets:precompile RAILS_ENV=production --trace
rails server -b 0.0.0.0 -p 3000 -e production
重启了 server 还是不行。firefox debug 也没有文件找不到的错误,但是 js 效果就是没有。到底是为什么?!