使用twitter-bootstrap-rails gem进行资产预编译失败

时间:2012-11-03 16:28:04

标签: ruby-on-rails twitter-bootstrap asset-pipeline

我有一个带有twitter-boostrap-rails gem的Rails 3.2应用程序。运行rake资产:预编译失败:

alex@BlackBeast:~/myapp$ rake assets:precompile
/home/alex/.rvm/rubies/ruby-1.9.3-head/bin/ruby /home/alex/.rvm/gems/ruby-1.9.3-head@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Invalid CSS after "...4882640c.png"")": expected "{", was ";background-pos..."
  (in /home/alex/myapp/app/assets/stylesheets/application.css)

Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/home/alex/.rvm/rubies/ruby-1.9.3-head/bin...]

有什么办法可以调试这个问题吗?不知道该怎么做。

将twitter-bootstrap-rails gem更新为2.1.6版本后,

更新:,预编译现在失败,出现了不同的错误:

rake aborted!
Invalid CSS after "}​": expected "{", was ""
  (in /home/alex/myapp/app/assets/stylesheets/application.css)
(sass):1673

错误中提到的application.css是标准的,

*= require_self
 *= require_tree .

..这有点难以确定哪个部分会导致问题。

我能以某种方式编译bootstrap_and_overrides.less并查看出错的地方吗?

1 个答案:

答案 0 :(得分:1)

似乎已在最新版本(2.1.6)中修复。 把它放在你的gemfile中应该可以解决问题。

gem 'twitter-bootstrap-rails' , '>= 2.1.6'