Rails 无法调用未定义的方法“charAt" [英] Rails Cannot call method 'charAt' of undefined

查看:50
本文介绍了Rails 无法调用未定义的方法“charAt"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Rails 应用程序收到以下错误:

I have a Rails app getting the following error:

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:

Some GEMS I'm using:

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 似乎有问题.

It seems to be a problem with LESS that Bootstrap uses.

我已经阅读了其他几个类似的问题.所以,我将 Ruby 升级到 1.9.3p374.但是,这并没有解决问题.

I've read several other similar issues. So, I upgraded Ruby to 1.9.3p374. But, that didn't fix the problem.

有什么想法吗?

谢谢!

更新

这是 bootstrap_and_overrides.css.less

This is the 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");

推荐答案

在评论中跟进您之后.似乎答案在于用 twitter-bootstrap-rails 或 less-rails 打开一个 github 问题来描述您的问题.您还可以关注原始问题:https://github.com/seyhunak/twitter-bootstrap-rails/issues/72

After following up with you in the comments. It seems the answer lies in opening a github issue with either twitter-bootstrap-rails or less-rails describing your issue. You could also follow on the original issue: https://github.com/seyhunak/twitter-bootstrap-rails/issues/72

另外两种解决方案提供给您:

Otherwise two solutions are offered to you:

  1. 使用 SASS 版本:https://github.com/jlong​​/sass-twitter-bootstrap
  2. 使用他们网站上提供的原生 css 版本:http://twitter.github.com/bootstrap/customize.html

这篇关于Rails 无法调用未定义的方法“charAt"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆