简体   繁体   中英

ActionView::Template::Error ('twitter/bootstrap/bootstrap.less' wasn't found

Trying to get bootstrap working and it is on a local server but after being deployed to heroku the page wont load. I've tried moving the gem outside fo the assets but either way I get the same errors. Any help would be greatly appreciated

Heroku Logs

2012-09-22T21:51:41+00:00 app[web.1]: Processing by MainController#admin as HTML
2012-09-22T21:51:41+00:00 app[web.1]:   Rendered main/admin.html.erb within layouts/admin (43.1ms)
2012-09-22T21:51:41+00:00 app[web.1]:     8: 
2012-09-22T21:51:41+00:00 app[web.1]: Completed 500 Internal Server Error in 574ms
2012-09-22T21:51:41+00:00 app[web.1]:     10:   
2012-09-22T21:51:41+00:00 app[web.1]:     12:   <%= stylesheet_link_tag    "tableStyle", :media => "all" %>
2012-09-22T21:51:41+00:00 app[web.1]:     11:  <%= stylesheet_link_tag    "bootstrap_and_overrides", :media => "all" %>
2012-09-22T21:51:41+00:00 app[web.1]: 
2012-09-22T21:51:41+00:00 app[web.1]: 
2012-09-22T21:51:41+00:00 app[web.1]: ActionView::Template::Error ('twitter/bootstrap/bootstrap.less' wasn't found.
2012-09-22T21:51:41+00:00 app[web.1]:   (in /app/app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2012-09-22T21:51:41+00:00 app[web.1]:     9:   <title>Live Well Chicago L.L.C</title>
2012-09-22T21:51:41+00:00 app[web.1]:   app/views/layouts/admin.html.erb:11:in `_app_views_layouts_admin_html_erb__2391414357054926185_30786800'
2012-09-22T21:51:41+00:00 app[web.1]: 
2012-09-22T21:51:41+00:00 app[web.1]: 
2012-09-22T21:51:41+00:00 app[web.1]:   app/controllers/main_controller.rb:19:in `admin'
2012-09-22T21:51:41+00:00 app[web.1]:     13:   <%= javascript_include_tag "application" %>

Gemfile

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'twitter-bootstrap-rails'

   # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platform => :ruby

  gem 'uglifier', '>= 1.0.3'
    end

[EDIT] Well Ive narrowed down the issue to bootstrap_and_overrides.css.less, pretty much all the import statements

@import "twitter/bootstrap/responsive";
@import "twitter/bootstrap/responsive";
@import "fontawesome";

Im a bit thrown of because when running a sever from the terminal rails is capable of retrieving the proper assets, however, after being deployed it has no idea where they are. Also im not sure if the files are supposed to be hidden but the 'twitter' folder is no where to be found in my project folder at least its not visible

Are you using a gem? Make sure your gem is not part of the assets group and is accessible in production.

From GemFile

Gems used only for assets and not in production environments by default.

So just move the gem outside of any group and you should be okay.

好吧,显然在某些方面(不完全确定何时)摆弄rails g bootstrap:安装错误开始提出一个JS Parse错误,我已经在这个项目的不同阶段已经有几次,基本上所有我不得不这样做删除了由早期命令生成的application.html布局文件的require_tree部分,现在它运行顺利

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM