我正在使用 Twitter 的 Bootstrap 转换为 SCSS 文件。它适用于本地开发,但是当我预编译并推送到 Heroku(使用 Cedar 堆栈)时,我得到了这个:
> Started GET "/" for 74.57.16.130 at 2012-01-28 17:16:36 +0000
> Processing by StaticPagesController#home as HTML Rendered
> static_pages/home.html.erb within layouts/application (0.7ms)
> Completed 500 Internal Server Error in 4ms
>
> ActionView::Template::Error (couldn't find file 'twitter/bootstrap'
> (in /app/app/assets/stylesheets/application.scss.css:11)):
> 8: </head>
> 6: <%= javascript_include_tag "application" %>
> 4: <title><%= full_title(yield(:title)) %></title>
> 2: <html>
> 5: <%= stylesheet_link_tag "application", :media => "all" %>
app/views/layouts/application.html.erb:5:in
> `_app_views_layouts_application_html_erb___288948710373692320_32137840'
> 3: <head> cache: [GET /] miss
>
> 7: <%= csrf_meta_tags %> cache: [GET /favicon.ico] miss
我使用的是 Rails 3.2.0,该应用程序一直在 Heroku 上运行,直到我添加了 SASS 文件。
最佳答案
你在用 gem 吗?确保您的 gem 不是 Assets 组的一部分,并且可以在生产环境中访问。
来自 GemFile
# Gems used only for assets and not in production environments by default.
因此,只需将 gem 移出任何组,就可以了。
关于ruby-on-rails - 在生产中找不到文件 'twitter/bootstrap',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9047478/