通过 twitter-bootstrap-rails gem 升级到 bootstrap 2.0.1 后 Heroku 部署失败

发布于 2025-01-08 05:24:30 字数 2939 浏览 1 评论 0原文

更新:

在 git push heroku master 期间显示此错误:

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       couldn't find file 'twitter/bootstrap'
       (in /tmp/build_2pmsvze33th3e/app/assets/javascripts/application.js:9)

       Tasks: TOP => assets:precompile:primary
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

我按照此 指南。之后,我在部署到 Heroku 时遇到此错误:

2012-02-23T23:12:09+00:00 app[web.1]: ActionView::Template::Error ('twitter/bootstrap.less' wasn't found.
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]:   (in /app/app/assets/stylesheets/bootstrap.css.less)):
2012-02-23T23:12:09+00:00 app[web.1]:     7:     /%title gitwatcher.com
2012-02-23T23:12:09+00:00 app[web.1]:     8:     = csrf_meta_tags
2012-02-23T23:12:09+00:00 app[web.1]:     9:     = stylesheet_link_tag "vendor",       :media => "screen"
2012-02-23T23:12:09+00:00 app[web.1]:     10:     = stylesheet_link_tag "application",  :rel => "stylesheet"
2012-02-23T23:12:09+00:00 app[web.1]:     11:     = stylesheet_link_tag "http://jqueryui.com/repository/tags/latest/themes/base/jquery.ui.all.css", :media => "screen, projection"
2012-02-23T23:12:09+00:00 app[web.1]:     12:     / 
2012-02-23T23:12:09+00:00 app[web.1]:     13:     :css
2012-02-23T23:12:09+00:00 app[web.1]:   app/views/layouts/application.html.haml:10:in `_app_views_layouts_application_html_haml___2608554683581233975_52490540'
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]: cache: [GET /] miss
2012-02-23T23:12:09+00:00 app[web.1]:   Processing by HomeController#index as HTML
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-tab.html.haml (4.5ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-table.html.haml (30.2ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (101.7ms)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled vendor.css  (3ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled css3-github-buttons/gh-buttons.css  (0ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled jquery_carousel/carousel.css  (0ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled application.css  (2ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Completed 500 Internal Server Error in 858ms

以前我有一个现有的 Rails 3.1.3 应用程序已经在 Heroku Cedar 上使用 Bootstrap 2 布局。

有什么想法吗?

UPDATE:

this error is shown during git push heroku master :

-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       couldn't find file 'twitter/bootstrap'
       (in /tmp/build_2pmsvze33th3e/app/assets/javascripts/application.js:9)

       Tasks: TOP => assets:precompile:primary
       (See full trace by running task with --trace)
       Precompiling assets failed, enabling runtime asset compilation
       Injecting rails31_enable_runtime_asset_compilation
       Please see this article for troubleshooting help:
       http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

I upgraded Bootstrap 2 layout to 2.0.1 by following this guide. After that I get this error deploing to Heroku :

2012-02-23T23:12:09+00:00 app[web.1]: ActionView::Template::Error ('twitter/bootstrap.less' wasn't found.
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]:   (in /app/app/assets/stylesheets/bootstrap.css.less)):
2012-02-23T23:12:09+00:00 app[web.1]:     7:     /%title gitwatcher.com
2012-02-23T23:12:09+00:00 app[web.1]:     8:     = csrf_meta_tags
2012-02-23T23:12:09+00:00 app[web.1]:     9:     = stylesheet_link_tag "vendor",       :media => "screen"
2012-02-23T23:12:09+00:00 app[web.1]:     10:     = stylesheet_link_tag "application",  :rel => "stylesheet"
2012-02-23T23:12:09+00:00 app[web.1]:     11:     = stylesheet_link_tag "http://jqueryui.com/repository/tags/latest/themes/base/jquery.ui.all.css", :media => "screen, projection"
2012-02-23T23:12:09+00:00 app[web.1]:     12:     / 
2012-02-23T23:12:09+00:00 app[web.1]:     13:     :css
2012-02-23T23:12:09+00:00 app[web.1]:   app/views/layouts/application.html.haml:10:in `_app_views_layouts_application_html_haml___2608554683581233975_52490540'
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]: 
2012-02-23T23:12:09+00:00 app[web.1]: cache: [GET /] miss
2012-02-23T23:12:09+00:00 app[web.1]:   Processing by HomeController#index as HTML
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-tab.html.haml (4.5ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered shared/_watch-list-table.html.haml (30.2ms)
2012-02-23T23:12:09+00:00 app[web.1]: Rendered home/index.html.haml within layouts/application (101.7ms)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled vendor.css  (3ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled css3-github-buttons/gh-buttons.css  (0ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled jquery_carousel/carousel.css  (0ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Compiled application.css  (2ms)  (pid 1)
2012-02-23T23:12:09+00:00 app[web.1]: Completed 500 Internal Server Error in 858ms

Previously I got an existing Rails 3.1.3 app already working with Bootstrap 2 layout on Heroku Cedar.

Any idea ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

还给你自由 2025-01-15 05:24:30

删除以下文件 app/assets/stylesheets/bootstrap.css.less 并享受。
来源 https://github.com/seyhunak/twitter-bootstrap-rails/issues/ 123

Remove the following file app/assets/stylesheets/bootstrap.css.less and enjoy.
Soruce https://github.com/seyhunak/twitter-bootstrap-rails/issues/123

清引 2025-01-15 05:24:30

我还将 gem“twitter-bootstrap-rails”移到资产组之外,这很有效!

I also moved gem "twitter-bootstrap-rails" outside the assets group and that works!

怂人 2025-01-15 05:24:30

我只需将 gem“twitter-bootstrap-rails”移出 :assets 块并将其放在 gemfile 的顶部即可解决此问题。

I was able to fix this issue by simply moving gem "twitter-bootstrap-rails" out of the :assets block and putting it at the top of my gemfile.

绳情 2025-01-15 05:24:30

解决了。

只需在 Gemfile 中注释掉以下行:

#gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'

并使用 gem "twitter-bootstrap-rails", "~> 2.0.1.0" 然后运行 ​​bundle update

即可完成,我之前失败的分支是:

-  revision: a5d67d23afeaa76eb52c6f87d55ff407f9c753f2
-    twitter-bootstrap-rails (2.0.1)

Solved.

Simply by comment out the following line in Gemfile :

#gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'

and using gem "twitter-bootstrap-rails", "~> 2.0.1.0" then running bundle update

To be complete, my previous failing branch was :

-  revision: a5d67d23afeaa76eb52c6f87d55ff407f9c753f2
-    twitter-bootstrap-rails (2.0.1)
夜光 2025-01-15 05:24:30

对我来说,解决方案是删除 application.css

*= require twitter/bootstrap

Se https://github .com/seyhunak/twitter-bootstrap-rails/issues/123

For me the solution was to remove this line in application.css

*= require twitter/bootstrap

Se https://github.com/seyhunak/twitter-bootstrap-rails/issues/123

晨光如昨 2025-01-15 05:24:30

运行时资产编译期间出现错误的另一个解决方法是使用 asset_sync gem。

Another workaround for errors during runtime asset compilation is to use the asset_sync gem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文