I'm trying to use the Twitter-bootstrap-rails gem for the first time and I'm having some issues. I deleted all the stylesheets that rails generates except for application.css and I ran
rails g bootstrap:install less
to get the bootstrap_and_overrides.css.less file. According to the documentation you need to require bootstrap_and overrides in application.css which I did.
Application.css looks like this:
*
*= require_tree .
*= require bootstrap_and_overrides.css.less
*= require_self
*/
and bootstrap_and_overrides.css.less looks like this:
@import "twitter/bootstrap/bootstrap";
@import "twitter/bootstrap/responsive";
// bootstrap variables and mixins
@import "twitter/bootstrap/variables.less";
@import "twitter/bootstrap/mixins.less";
// other auto generated code below
The problem is that when I'm getting this error when I try to run the app:
NoMethodError in StaticPages#home
Showing /home/sheeka/Documents/workspace/my_projects/ruby/testapps/media_store/app/views/layouts/application.html.erb where line #5 raised:
undefined method `[]' for nil:NilClass
and line 5 points to
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
When I remove application.css everything loads with no problem but there's no bootstrap styling. Any help figuring this out would be much appreciated.
less-rails
gem? – Deepesh