2
votes

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

2

2 Answers

6
votes

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.

2
votes

Alright so apparently at some point (not entirely sure when) of fiddling around with rails g bootstrap:install the error started bringing up a JS Parse error which Ive had a few times already in different stages with this project and basically all I had to do was remove the require_tree portion of the application.html layout file which was generate by the earlier command and its all running smoothly now