加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Rails无法调用未定义的方法’charAt’

发布时间:2020-12-16 19:13:24 所属栏目:百科 来源:网络整理
导读:我有一个Rails应用程序收到以下错误: Less::ParseError in Home#indexShowing /Users/burtondav/sites/requestsys/app/views/layouts/application.html.erb where line #20 raised:Cannot call method 'charAt' of undefined (in /Users/burtondav/sites/re
我有一个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.但是,这并没有解决问题.

有任何想法吗?

谢谢!

UPDATE

这是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

否则,将为您提供两种解决方案:

>使用SASS版本:https://github.com/jlong/sass-twitter-bootstrap
>使用其网站上提供的本机css版本:http://twitter.github.com/bootstrap/customize.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读