-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rake assets:precompile fails: Undefined variable: '@alert-padding' #91
Comments
I'm getting the exact same error when I run: RAILS_ENV=production bundle exec rake assets:precompile --trace Results in failure to successfully precompile before deploying to Heroku |
@skellyc can you gist you gemfile? |
I also got this problems. This is my Gemfile
|
Hello, same error here, this is my gemfile source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
gem 'devise'
gem 'cancan', github: 'ryanb/cancan'
#gem 'mysql2', platform: :ruby
gem 'activerecord-jdbcmysql-adapter'
gem 'json_builder'
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass'
gem 'ng-rails-csrf'
gem 'puma'
gem 'capistrano', group: :development
gem 'capistrano-rails', group: :development
gem 'capistrano-bundler', group: :development
gem 'capistrano-rvm', group: :development
gem 'capistrano-puma', require: false
gem 'sprockets-rails', :require => 'sprockets/railtie' |
@astenuz this is not thomas-mcdonald/bootstrap-sass gem. This is anjlab-bootstrap-rails |
Actually, tried with these Gemfiles - everything is ok. Can some post application.css.scss? |
@yury, you're right, however, it is the same error, could this be that the error is not generated by the bootstrap gem itself?. Actually i started having it when i had to add sprockets gem, before that it was precompiling correctly. here is the stacktrace
|
Facing the same error. |
@tomoyuki28jp application.css.scss? |
@yury, thanks for your reply! Here is my application.css.scss /*
*= require_self
*= require_tree .
*/
@import "twitter/bootstrap"; I'm using bootstrap variables in other css files. @import "twitter/bootstrap/variables";
.user { font-size: $font-size-base; } And I get errors like this one: 5) Posts GET /posts works! (now write some real specs)
Failure/Error: get posts_path
ActionView::Template::Error:
Undefined variable: "$font-size-base".
(in /Users/tomo/foo/app/assets/stylesheets/application.css.scss) |
Here is my Gemfile abount anjlab-bootstrap-rails. Gemfile gem 'anjlab-bootstrap-rails',
require: 'bootstrap-rails',
github: 'anjlab/bootstrap-rails' Gemfile.lock GIT
remote: git://github.com/anjlab/bootstrap-rails.git
revision: 461121444e24cdf78357418bfca9f2b8a9a1c518
specs:
anjlab-bootstrap-rails (3.0.3.0)
railties (>= 3.0)
sass (>= 3.2) |
is your gem on top most group in Gemfile? not in assets? |
what if you remove //require_self and require_tree . and put something like this: @import "twitter/bootstrap";
@import "posts/index"; |
@yury Not in assets. source 'https://rubygems.org'
gem 'rails', '4.0.1'
gem 'mysql2'
gem 'therubyracer'
gem 'sass-rails', '~> 4.0.0'
gem 'anjlab-bootstrap-rails',
require: 'bootstrap-rails',
github: 'anjlab/bootstrap-rails' |
@yury, I've tried this: @import "twitter/bootstrap";
@import "posts/index"; But I get the same error like: Undefined variable: "$font-size-base". |
@yury Ah, sorry. Removing "require_tree ." and import each CSS file actually works. Importing all the CSS files manually is not an ideal way, is there a better way to fix it? |
require_tree is just recursively pulling in each individual scss file so the sass isn't getting properly complied. Just go to your main scss file (whatever you have the file named) and perform an @import to bootstrap. @tomoyuki28jp if you use the @import method I described you won't actually be doing anything "manually" sass with just pull everything in automatically. The only import you really need to do is the main bootstrap sass file. |
@scottsword Thanks for your reply. I tried your way, but it doesn't work for me. If I use |
Hi I'm also having the same issue.
I'm using
Here is my gist url :
In my gem file I've three Gems which are mostly using
when I've applied the 'active_admin' gem and push to server I've got error in assets precompile
Now I've added gem "'comfortable_mexican_sofa', '~> 1.12.0'" and I've this issue : Sass::SyntaxError: Undefined variable: "$alert-padding" I've tried with the one solution by adding
but after this I've got another issue with active admin
I don't have 'apllication.css.scss' file in my assets. |
Facing a similar error here.
I looked up with
But still the same error appears. Following the advice of this post on SO, I've done a |
Did anyone find a solution to this? |
Hello EveryOne. config.assets.precompile << %w( *.scss *.js ) |
Undefined variable: "$alert-padding".
(in /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/anjlab-bootstrap-rails-3.0.2.0/app/assets/stylesheets/twitter/bootstrap/_alerts.scss)
/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/anjlab-bootstrap-rails-3.0.2.0/app/assets/stylesheets/twitter/bootstrap/_alerts.scss:10
/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/script/variable.rb:49:in
_perform' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/script/node.rb:40:in
perform'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:298:in
visit_prop' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:37:in
visit'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:100:in
visit' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:53:in
block in visit_children'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:53:in
map' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:53:in
visit_children'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:109:in
block in visit_children' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:121:in
with_environment'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:108:in
visit_children' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:37:in
block in visit'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:320:in
visit_rule' /Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/base.rb:37:in
visit'/Users/pavlo/.rvm/gems/ruby-2.0.0-p195/gems/sass-3.2.10/lib/sass/tree/visitors/perform.rb:100:in `visit'
The text was updated successfully, but these errors were encountered: