I am getting the following error. According to my R&D i believe it is producing because of bootstrap-sass but how can i resolve it I have tried very hard but still unable to get something.
ruby -v = 1.9.3
rails = 3.2.2
GemFile
"bootstrap-sass", "~> 2.0.0" # this is out of assets group
ActionView::Template::Error (File to import not found or unreadable: bootstrap.
Load paths:
/var/www/eventdid
/var/www/eventdid/vendor/bundle/ruby/1.9.1/gems/activeadmin-0.4.4/app/assets/stylesheets
/var/www/eventdid/vendor/bundle/ruby/1.9.1/gems/compass-0.12.6/frameworks/compass/stylesheets
(in /var/www/eventdid/app/assets/stylesheets/site.css.scss)):
I have been digging my head into this issue from hours and hours. Looking forward help from you guys.
Thanks
If you are not using pre-compiled assets you should move your
gem 'sass-rails'
also out of your assets group.
Also worth checking, you should use scss in your application.css.scss
#import "twitter/bootstrap";
#import "twitter/bootstrap-responsive";
Related
I'm trying to have forums on an application i'm writing. I've got the forum working through the installation found on http://www.sitepoint.com/forem-rails-forum-engine/
The error I'm getting is:
Sass::SyntaxError in Forem::Forums#show
File to import not found or unreadable: forem-bootstrap
It highlights the code from vendor/assets/stylesheets.forem.css.scss
#import 'forem-bootstrap';
I've bundle installed the gem the installation site told me inside my Gemfile:
gem 'forem-bootstrap', github: "radar/forem-bootstrap"
If I get rid of the #import line from stylesheets/forem.css.scss it loads the forums just fine. Any ideas how to get the bootstrap gem to work with Forem?
I'm using bourbon and Neat with rails application.
I can't make Neat run, one of the most common error that I get is:
error stylesheets/sass/neat/functions/_private.scss (Line 48: Invalid CSS after "... $grid-columns ": expected "}", was "!global !default;")
(and if I comment this line will be just another line)
I'm using Neat 1.5.1 with sass-rails
This is my gem file:
# Use SCSS for stylesheets
gem 'sass-rails', '>= 4.0.2'
gem 'leaflet-rails'
gem 'bourbon'
gem 'neat', '1.5.1'
I have
#import "bourbon/bourbon";
#import "grid-settings";
#import "neat/neat";
#import "setting";
in my main.scss
and
#import "main";
in my application.css.scss
If I put neat in application.css.scss I get "Undefined Mixing Error"
I already did bundle install, re-start the serve and clear the cache.
This might help you, seems like this is a known issue: https://github.com/thoughtbot/neat/issues/170
Seems the main problem was the sass/neat folder.
If you're using the gem, you don't have to create one, is just for project without Ruby And Rails.
Is just not very clear in the instruction :)
I have an existing Rails 3.2.14 application that I am trying to add zurb-foundation to. I have added the zurb-foundation gem and run the installation generator.
My problem is that, whenever I try to load a page, I get this error:
couldn't find file 'foundation'
when Sprockets hits the
//= require foundation
line in application.js
The problem appears to be that the directory with the assets from the zurb-foundation gem are not being added to the load path. In contrast, I have an application that I generated more recently, including zurb-foundation from the beginning, and #asset_paths.asset_environment.paths includes the following
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-rails-3.0.4/vendor/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.2/lib/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.0/scss",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.0/js"
which are not included in the asset load path in the app I am updating. Instead, I am getting (with p #asset_paths.asset_environment.paths in the better_errors diagnostic window)
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/images",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/stylesheets",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-rails-3.0.4/vendor/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.2/lib/assets/javascripts"
interestingly, if I run the console in development mode and look at Rails.application.config.assets.path, it includes:
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/images",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-ui-rails-4.0.4/app/assets/stylesheets",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/jquery-rails-3.0.4/vendor/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/coffee-rails-3.2.2/lib/assets/javascripts",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.1/scss",
"/usr/local/var/rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/zurb-foundation-4.3.1/js"
and that DOES include the zurb-foundation asset paths.
I have included gem 'zurb-foundation' in the assets group, in the development group, and outside any group. I am using zurb-foundation-4.3.1 in the new app.
My Gemfile assets group is:
group :assets do
gem 'sass-rails'
gem 'coffee-rails'
gem 'uglifier'
gem 'compass-rails'
gem 'zurb-foundation'
end
This problem seems similar to Sprockets::FileNotFound with ZURB Foundation, although Jurriaan did not mention the asset load path.
Any idea what I could be missing?
Thanks!
Have you tried restarting the webserver?
Update:
You said it runs fine in development, Have you tried to rake assets:clean and rake assets:precompile?
It was a problem with a gem that was preventing foundation's entries being added to the load_path. The gem involved was mongomapper-versioned.
By not loading that gem, the problem resolved. By adding the gem back, the problem recurs.
That gem has not had any activity for two years. I guess it's time to find something else.
I'm trying to create a gem which represents a JS and CSS library and can be included in rails projects (currently using 3.2). All the style sheets are written in SASS and depend on the compass library.
I tried adding compass-rails to the Gemfile of the "external" gem and including it in the gems SASS files using
#import "compass"
However, back in the rails application (which has a dependency to this gem), this results in an error message:
File to import not found or unreadable: compass.
Am I doing something wrong?
Update: It seems to work if I add gem compass-rails to the Gemfile of the rails application. Any change to work around that?
Thanks a lot for your help!
Besides adding compass-rails to the Gemfile of the gem, you also need to require 'compass-rails' somewhere, adding it to lib/your_gem_name.rb inside the gem worked for me.
I recently upgraded to rails 3.1 and also installed the Bourbon gem in my rails 3.1 app. Added this to my gemfile: gem 'bourbon' and ran $ bundle install but when in my application.css.scss I add the #import "bourbon"; line, i get the following error:
File to import not found or unreadable: bourbon.
Load path: Sass::Rails::Importer ...
here is my application.css.scss file
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*/
#import "bourbon";
#import "scaffold.css.scss";
.hidden{
display:none;
}
any idea how to load Boubon? what am I doing wrong?
I am guessing there need to be some files that need to be generated for rails to access bourbon library, no?
Any help or clues will be much appreciated
alik, try specifying the gem version number in your gemfile. https://rubygems.org/gems/bourbon
gem "bourbon", "~> 0.2.1"
rake bourbon:install will not help you on rails 3.1+