我最近被分配了一项任务来更改网站的主题。最初它是使用bootstrap,我使用bootswatch主题来重新设计它。一切都很好,在当地看起来很好。但是在我将资产部署到生产环境之前,我必须预先编译我的资产。
`$ bundle exec rake assets:precompile`
失败,出现以下错误。我花了几天时间在互联网上挖掘,但对Avail没有帮助。
使用jruby-1.7.18
Gemfile的一部分
# Styling
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
gem 'jquery-ui-rails'
gem 'jquery-rails', '~> 2.3.0'
gem 'bootstrap-datetimepicker-rails'
gem 'jquery_datepicker'
gem 'bootstrap-sass'
gem 'twitter-bootstrap-rails'
gem 'therubyrhino'
gem 'less-rails'
错误
`** 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!
Less::ParseError: variable @alert-padding is undefined
(in /Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/twitter-bootswatch-rails-3.3.2.0/vendor/toolkit/twitter/bootstrap/alerts.less)
at /Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/less-2.6.0/lib/less/js/lib/less/parser.js:604 (anonymous)
at org/mozilla/javascript/gen//Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/less-2.6.0/lib/less/js/lib/less/parser.js:604 (anonymous)
/Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/therubyrhino-2.0.4/lib/rhino/context.rb:259:in `open'
/Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/therubyrhino-2.0.4/lib/rhino/context.rb:252:in `open'
/Users/hnaras2967c/.rvm/gems/jruby-1.7.18@cimport/gems/less-2.6.0/lib/less/java_script/rhino_context.rb:37:in `exec'`
答案 0 :(得分:0)
应该有一个bootstrap-overrides或类似的样式表,你应该定义@ alert-padding变量