3

I have a rails application which is running well in local (OsX, WEBrick).

I've cloned the repo on a server (Ubuntu 10.04, Apache, Passenger), setted up passenger, but now when i try to connect to every page i get

Less::ParseError in Pages#home

Showing /var/www/MYAPP/app/views/layouts/application.html.erb where line #5 raised:

Cannot call method 'charAt' of undefined
  (in /usr/lib/ruby/gems/1.8/gems/twitter-bootstrap-rails-2.0.2/vendor/assets/stylesheets/twitter/bootstrap.css.less)

the content of bootstrap.css.less is:

@import "twitter/bootstrap/bootstrap";

line 5 of application.html.erb is:

<%= stylesheet_link_tag    "application" %>

ruby 1.8.7 on both machines

Sameera Thilakasiri
  • 9,452
  • 10
  • 51
  • 86
qwertoyo
  • 1,332
  • 2
  • 15
  • 31

3 Answers3

1

solved upgrading to ruby 1.9.3

qwertoyo
  • 1,332
  • 2
  • 15
  • 31
1

Upgrading less worked for me on Ubuntu server 10.04

For system wide:

sudo npm -g install less

For user only:

npm install less
Koen.
  • 25,449
  • 7
  • 83
  • 78
0

I believe this has something to do with the Ruby less gem not compiling it correctly. I had this problem locally on mac as well. Somewhere I saw a suggestion to use the node version of less (1.3) instead of the ruby gem, which you can install with npm install less.

However, most of the gems that hook up bootstrap to rails use the ruby gem version, so it seemed like a no go, esp on heroku etc. After a very frustrating couple of days on this I gave up and switch to the sass version of bootstrap: https://github.com/thomas-mcdonald/bootstrap-sass

It was simpler to integrate with rails, but unfortunate to be off the official version of bootstrap. I later went to integrate bootswatch but this doesn't play well with sass either. So I'm back to the plain old css version of bootswatch for now until a better way to handle this comes out :/

Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144