Я в моем остроумии конец с этим. Кажется, все новые приложения для рельсов я делаю, устанавливаю пару конфигураций в 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