Ruby on rails Heroku部署在通过twitter引导程序升级到引导程序2.0.1后失败
更新: 此错误在git push heroku master期间显示:Ruby on rails Heroku部署在通过twitter引导程序升级到引导程序2.0.1后失败,ruby-on-rails,heroku,asset-pipeline,twitter-bootstrap,Ruby On Rails,Heroku,Asset Pipeline,Twitter Bootstrap,更新: 此错误在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/
-----> 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
我通过以下步骤将Bootstrap2布局升级到2.0.1。在此之后,我在向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
之前,我已经在Heroku Cedar上开发了一个现有的Rails 3.1.3应用程序,它已经在使用Bootstrap 2布局
有什么想法吗?解决了
只需在文件中注释掉以下行:
#gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'
并使用gem“twitter引导程序rails”、“~>2.0.1.0”
然后运行bundle update
完整地说,我以前失败的分支是:
- revision: a5d67d23afeaa76eb52c6f87d55ff407f9c753f2
- twitter-bootstrap-rails (2.0.1)
删除以下文件app/assets/stylesheets/bootstrap.css.less并享受。
Soruce对我来说,解决方案是删除application.css中的这一行
*= require twitter/bootstrap
Se我只需将gem“twitter bootstrap rails”移出:assets块并放在我的gem文件的顶部,就可以解决这个问题。我还将gem“twitter bootstrap rails”移出了assets组,这样做很有效 运行时资产编译过程中出现错误的另一个解决方法是使用gem。奇怪的是,它在
/app/app/assets/stylesheets/bootstrap.css中查找。less
-你是说要有这样的嵌套应用程序文件夹吗?不,这来自heroku日志。我不知道如何摆脱这种情况,显然这似乎是一个路径错误/重复,但在以前的bootstrap-2部署(通过gem)中没有发生,而且,在本地它工作正常。。。