anjlab / bootstrap-rails

Twitter Bootstrap CSS (with Sass flavour) and JS toolkits for Rails 3 projects
https://github.com/anjlab/bootstrap-rails
729 stars 96 forks source link

File to import not found or unreadable: twitter/bootstrap #63

Closed Signum closed 11 years ago

Signum commented 11 years ago

I tried to use the Gem but failed with the above error message.

I'm using RVM. The twitter/bootstrap files are shown when I call "gem contents anjlab-bootstrap-rails". They are located in $HOME/.rvm/gems/ruby-1.9.3-p374/gems/anjlab-bootstrap-rails-3.0.0.1/app/assets/stylesheets/twitter/bootstrap/ for example.

My Gemfile reads (at the very end):

gem 'anjlab-bootstrap-rails', '>= 3.0.0.0'

My app/assets/stylesheets/application.css.scss reads:

/*
 *= require_self
 *= require_tree .
 *= require fancybox
 */
@import "twitter/bootstrap";

My app/assets/javascripts/application.js reads:

//= require jquery
//= require jquery_ujs
//= require fancybox
//= require turbolinks
//= require twitter/bootstrap
//= require_tree .

I ran "bundle install" which shows (among others):

Using anjlab-bootstrap-rails (3.0.0.1) 

I'm using Rails 4.0.0.

What could be wrong?

yury commented 11 years ago

It should be

gem 'anjlab-bootstrap-rails', '>= 3.0.0.0', require: 'bootstrap-rails'

in your Gemfile

yury commented 11 years ago

Fixed, README. Sorry for that.

tehviking commented 11 years ago

I'm having this same issue in Rails 4, even with the new README.

Signum commented 11 years ago

Thanks for your very quick reaction. Seems to have fixed it for me. Tried it on another computer though.

yury commented 11 years ago

@tehviking can you gist your Gemfile?

softporcupine commented 11 years ago

I am also having the same problem. Calling "gem contents anjlab-bootstrap-rails" displays the contents as expected.

My Gemfile has these lines (among others):

gem 'rails', '4.0.0'
gem 'sass-rails', '~> 4.0.0'
gem 'anjlab-bootstrap-rails', '>= 3.0.0.0', :require => 'bootstrap-rails'

My app/assets/stylesheets/application.css.scss reads:

 *
 *= require_self
 *= require_tree .
 */
@import "twitter/bootstrap";

My app/assets/javascripts/application.js reads:

//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require twitter/bootstrap
//= require_tree .

I ran "bundle install" which shows (among others):

Using anjlab-bootstrap-rails (3.0.0.2)

I get the

Sass::SyntaxError in Welcome#index
File to import not found or unreadable: twitter/bootstrap.

Any ideas as to what could be wrong?

softporcupine commented 11 years ago

Nevermind, this looks like a silly mistake on my part. I was just trying to refresh the page without restarting the WEBrick server. Once I restarted WEBrick it worked.