sam452
sam452

Reputation: 1321

Rails3 couldn't find file 'bootstrap'

This has hit me twice and I cannot get past it this time. The first time, I pushed/pulled from github and got webrick to boot up. This a.m. I attempted to do the same thing. I do recall restarting my dev machine yesterday which would cause webrick to restart.

Background, this is my first 'production' app and I'm using danielkehoe's starter template on github that uses cucumber, rails3 and devise. I've chosen Twitter-bootstrap as my CSS generator.

Hunting on the web suggested bundle update, rebooting webrick. Of those google results that directly mirror mine, there was no resolution posted. I have branched out and installed rails 3.2 but that made no difference.

Here is the Exception:

couldn't find file 'bootstrap'
(in /Users/sam/apps/keriakut/app/assets/stylesheets/application.css.scss:6)

 Extracted source (around line #10):
 9:     <meta name="author" content="">
 10:     <%= stylesheet_link_tag    "application", :media => "all" %>
 11:     <%= javascript_include_tag "application" %>

My trace:

   app/views/layouts/application.html.erb:10:in
   `_app_views_layouts_application_html_erb___2282066720260402873_2178181480'

I would have thought that caching is not used in development mode and doesn't that file look like it's cached?

It seems there is no bootstrap document for twitter-bootstrap, but it seems to be incorporated into sass, scss files? This is my inexperience showing.

Based on another stackoverflow answer I added: gem "twitter-bootstrap-rails", "~> 2.0rc0" into my Gemfile but after updating, the results are not the same. I want to understand what I'm doing wrong with my environment to keep this coming up, sam

Upvotes: 1

Views: 8121

Answers (1)

danneu
danneu

Reputation: 9444

I think you're including too many unrelated details. Sounds like you have /*= require twitter/bootstrap or similar in your application.css.scss manifest and it can't be found. Bootstrap doesn't come with Rails or Sass. You can either drop it manually into your stylesheets directory from the Bootstrap website and require it or you can use one of the gems out there that contains it.

Since you're using the twitter-bootstrap-rails gem, the documentation says that you install it by running:

rails generate bootstrap:install

That will probably unpack the bootstrap css files from the gem into your stylesheets directory.

And your application.css.scss should contain:

*= require twitter/bootstrap

Upvotes: 2

Related Questions