我正在尝试在生产中启动我的 Rails 应用程序,但它不起作用并且无法启动并出现以下错误(它在开发中运行良好):
ActionView::Template::Eror (no such file to load -- sass in (/.../app/assets/stylesheets/file.css.scss)):
13: ...
14: <%= stylesheet_link_tag "application", media => "all" %>
15: ...
app/views/layouts/application.html.erb: 14:in '_app_views_layouts_application_html_erb'
我查看了这篇 StackOverflow 帖子:Rails Error In Production, may due to link_tag and precompilation并尝试安装 gem 'therubyracer' 但是一旦我这样做并尝试捆绑安装,它会在尝试安装 gem libv8 时失败(An error occurred while installing libv8 (3.16.14.3), and bundler cannot continue)
。
如果有帮助,我的 Gemfile 的相关部分:
gem 'rails', '3.2.12'
gem 'activerecord-jdbc-adapter', "1.2.2"
gem 'activerecord-jdbcpostgresql-adapter', '1.2.1'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'therubyrhino'
gem 'jquery-rails', '2.2.1'
gem 'less-rails', '2.3.3'
gem 'rubyzip', '0.9.9'
我的 config/database.yml 文件的生产部分(我使用的是 PostgreSQL,不知道这是否相关):
production:
adapter: jdbc
jndi: jdbc/appname
database: appname
user: appname
password: appname
host: <ip address>
我对如何继续感到非常困惑,任何帮助将不胜感激。
注意:我使用 warbler 创建了一个 .war 文件,然后尝试通过 GlassFish 启动它
编辑:我的 application.css 文件是:
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*= require bootstrap-datetimepicker
*= require bootstrap-select.min
*/