2

After updating rails from 3.2.3 to 3.2.14, and updating twitter-bootstrap-rails from 2.2.0 - 2.2.6 I'm getting this Less unrecognised input error:

 Less::Error - Unrecognised input
  (in /Users/andrew/rails/teebox_network/app/assets/stylesheets/bootstrap_and_overrides.css.less):
  (gem) less-2.4.0/lib/less/parser.rb:74:in `block (2 levels) in parse'
  at finish (/Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/less-2.4.0/lib/less/js/lib/less/parser.js:475:in `'
  at tree.importVisitor.run (/Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/less-2.4.0/lib/less/js/lib/less/import-visitor.js:25:in `'
  at Parser.parser.parse (/Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/less-2.4.0/lib/less/js/lib/less/parser.js:484:in `'

The offending lines appear to be first 2 in 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");

@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot");
@fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix");
@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff");
@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf");
@fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg");

// Font Awesome
@import "fontawesome";

// Glyphicons
@import "twitter/bootstrap/sprites.less";

Googling suggested to downgrade to 2.2.0, however the error remains. I am running less-rails (2.4.2), sass-rails (3.2.6), therubyracer (0.12.0). If anyone needs any other gem versions just shout.

Do I have to update a critical gem to fix this issue?

dodgerogers747
  • 3,325
  • 9
  • 34
  • 55

2 Answers2

4

The issue is with less-rails and not with bootstrap. It seems the less syntax has changed. A lot of people seem to have this problem right now: https://github.com/metaskills/less-rails/issues/71 has details.

The suggestion there, which works for me, was to make sure you use the older version of less-rails for now.

gem 'less-rails', '2.3.3'

in my Gemfile solved the issue for me.

chris
  • 151
  • 4
0

I never got to the bottom of this issues, but as I didn't require access to the bootstrap mixins I reinstalled twitter-bootstrap-rails but ran the static stylesheets generator, so I wasn't using Less anymore.

rails generate bootstrap:install static
dodgerogers747
  • 3,325
  • 9
  • 34
  • 55
  • I hate that you have to give up responsive to get past this. – sam452 Oct 31 '13 at 14:10
  • It didn't give up responsive abilities, they work absolutely fine, It just mean you couldn't use the LESS variables to define colors etc. Since I am using sass with Rails this wasn't an issue at all. – dodgerogers747 Oct 31 '13 at 17:23