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: responsive. #22

Closed vajapravin closed 12 years ago

vajapravin commented 12 years ago

I am using following gems and displaying text editor but its giving error in app_bootstrap.css.scss, thanks for any help.

Error: File to import not found or unreadable: responsive.

gem 'bootstrap-sass', '2.0.2' gem 'bootstrap-wysihtml5-rails' gem "anjlab-bootstrap-rails", "~> 2.0.4.1"

app_bootstrap.css.scss

// change colors $linkColor: red;

// change grid $gridColumnWidth: 70px; $gridGutterWidth: 10px;

// import original bootstrap @import "bootstrap"; @import "responsive";

thotmx commented 12 years ago

Take a look to the new README file

coreyward commented 12 years ago

@hermes-logicalbricks The newest README applies to 2.1+; the version specified here is up-to 2.0.5, so the new README with the namespacing probably doesn't apply.

@vajapravin23 You are already loading bootstrap-sass, which is a Sass version of Bootstrap. Why are you trying to load this Sass version of Bootstrap as well? I would pick one or the other, and I'm partial to this one, but only because I'm not familiar with the other.

What version does your Gemfile.lock specify for anjlab-bootstrap-rails?

asanghi commented 12 years ago

I see this problem but my prep is slightly better

Gemfile

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
  gem 'chosen-rails'
  gem 'anjlab-bootstrap-rails', '>= 2.1', require: 'bootstrap-rails'
  gem 'font-awesome-rails'
  gem 'bootstrap-datepicker-rails'
end

Gemfile.lock has the relevant versions (and vendor/cache has the updated gem file)

application.css

 *= require bootstrap_and_overrides

and in bootstrap_and_overrides

@import "twitter/bootstrap";
@import "twitter/bootstrap-responsive";
// overrides follow

During deployment i get

  * 00:27:24 == Currently executing `deploy:assets:precompile'
  * executing "cd /snip/apps/releases/20120822185710 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
    servers: ["snip"]
    [production.snip] executing command
 ** [out :: production.snip] rake aborted!
 ** [out :: production.snip] File to import not found or unreadable: twitter/bootstrap/bootstrap.scss.
 ** [out :: production.snip] Load path: Sass::Rails::Importer(/snip/apps/releases/20120822185710/app/assets/stylesheets/bootstrap_and_overrides.css.scss)
 ** [out :: production.snip] (in /snip/apps/releases/20120822185710/app/assets/stylesheets/bootstrap_and_overrides.css.scss)
 ** [out :: production.snip] Tasks: TOP => assets:precompile:primary
asanghi commented 12 years ago

By the way, no problems in development mode. Only when deploying or trying out asset precompiling on the command line.

asanghi commented 12 years ago

Reverting back to version 2.0.4.4 to continue

asanghi commented 12 years ago

Gems used when trying

sass - 3.2.1 sass-rails - 3.2.5 sprockets - 2.1.3 rails - 3.2.8 tilt - 1.3.3 anjlanb-bootstrap-rails - 2.1.0.0

Problem does not happen in compiling javascripts (i confirmed that by removing the bootstrap css requires/imports from my application).

asanghi commented 12 years ago

Also tried pulling this repo straight from github but still not working. removed my overrides and hooked application.css straight to anjlabs by requiring twitter/bootstrap in it.

[ 01:47:58 ] > RAILS_GROUPS=assets RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
File to import not found or unreadable: twitter/bootstrap/bootstrap.scss.
Load path: Sass::Rails::Importer(/usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/bootstrap-rails-9182e777aafb/vendor/assets/stylesheets/twitter/bootstrap.scss)
  (in /usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/bootstrap-rails-9182e777aafb/vendor/assets/stylesheets/twitter/bootstrap.scss)
/usr/local/rvm/gems/ruby-1.9.3-p194/bundler/gems/bootstrap-rails-9182e777aafb/vendor/assets/stylesheets/twitter/bootstrap.scss:1
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.1/lib/sass/tree/import_node.rb:64:in `rescue in import'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.1/lib/sass/tree/import_node.rb:42:in `import'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.1/lib/sass/tree/import_node.rb:25:in `imported_file'
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/sass-3.2.1/lib/sass/tree/visitors/perform.rb:227:in `rescue in visit_import'
asanghi commented 12 years ago

So i finally solved my problem because i'm fortunately not on heroku.

I had config.assets.initialize_on_precompile = false. This setting was needed for heroku (there was a good justification for it) but since i'm not on heroku and using capistrano to deploy to my own server i dont really need this setting.

I had to remove this configuration setting to make precompiling work.

yury commented 12 years ago

in v2.1.0.3 all should work fine now.

scottillogical commented 11 years ago

I'm getting this on anjlab-bootstrap-rails (2.2.2.0)

edit: looking into the solution in #35