На ръба си съм с това. Изглежда, че всички по-нови rails приложения, които правя, настройвам няколко конфигурации в environments/production.rb
, разгръщам и продължавам с живота си. Но сега мигрираме няколко rails приложения към нов сървър и изглежда, че всички имат този проблем при внедряване в производствена среда.
Това, което изглежда се случва, е, че нито моите javascripts, нито таблиците със стилове се компилират. И не виждам нито един от стиловете за приложението и javascript не работи.
config/application.rb:
require File.expand_path('../boot', __FILE__)
require 'rails/all'
if defined?(Bundler)
Bundler.require(:default, :assets, Rails.env)
end
module MyApp
class Application < Rails::Application
... omitted code ...
# 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'
config.generators.stylesheet_engine = :scss
end
end
config/environments/production.rb:
MyApp::Application.configure do
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
... omitted code ...
end
В моето приложение-‹...>.js:
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require_tree
;
И моето приложение-‹...>.css е напълно празно. какво ми липсва
gem 'execjs', gem 'therubyracer', :platforms => :ruby gem 'libv8', '3.3.10.4'
- person Sparkmasterflex   schedule 10.06.2014