我有一个 Rails 应用程序收到以下错误:
Less::ParseError in Home#index
Showing /Users/burtondav/sites/requestsys/app/views/layouts/application.html.erb where line #20 raised:
Cannot call method 'charAt' of undefined
(in /Users/burtondav/sites/requestsys/app/assets/stylesheets/bootstrap_and_overrides.css.less)
Extracted source (around line #20):
17: }
18: </style>
19:
20: <%= stylesheet_link_tag "application", :media => "all" %>
我正在使用的一些 GEMS:
gem 'rails', '3.2.11'
gem 'twitter-bootstrap-rails'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
gem 'commonjs'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
Bootstrap 使用的 LESS 似乎有问题。
我已经阅读了其他几个类似的问题。所以,我将 Ruby 升级到 1.9.3p374。但是,这并没有解决问题。
有任何想法吗?
谢谢!
更新
这是 bootstrap_and_overrides.css.less
@import "twitter/bootstrap/bootstrap";
@import "twitter/bootstrap/responsive";
// Set the correct sprite paths
@iconSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings");
@iconWhiteSpritePath: asset-path("twitter/bootstrap/glyphicons-halflings-white");