3

我运行时出现以下错误lessc bootstrap.less

at less.Parser.parser.parse.i (/Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/js/lib/less/parser.js:385:31): #grid > .core is undefined (Less::ParseError)
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/parser.rb:61:in `block in to_css'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:90:in `block in do_lock'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:88:in `call'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:88:in `Locker'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:88:in `do_lock'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:60:in `lock'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script/v8_context.rb:30:in `exec'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/java_script.rb:26:in `exec'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/parser.rb:61:in `to_css'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/bin/lessc:99:in `<top (required)>'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/bin/lessc:19:in `load'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/bin/lessc:19:in `<main>'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/bin/ruby_noexec_wrapper:14:in `<main>'

我发现了这个问题。但我已经将我的lessc 升级到1.3。

这是版本:

lessc -v

lessc 1.3.0 (LESS 编译器) [Ruby] 2.2.2

引导源文件是从 github 克隆的。

4

2 回答 2

5

我们需要升级 less 到 1.3.3 版本

示例(如果您在 node.js 中运行较少)

sudo npm install -g less
于 2013-02-12T08:51:46.473 回答
0

我找到了解决办法!

  1. 转到less.js 存储库并将存储库下载为 zip 文件
  2. 转到less.rb repo 的这个分支并将 repo下载为 zip 文件
  3. 将 /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/loader.rb 替换为步骤 2 中存储库中该文件的版本(lib/less /loader.rb)
  4. 将 /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/lib/less/js/ 的内容替换为步骤 1 中 repo 的内容

应该这样做!有两点需要注意:

  1. 当我实现这个解决方案时,我使用的是 ruby​​ 1.9.3-p385
  2. 将 /Users/ftiasch/.rvm/gems/ruby-1.9.3-p374/gems/less-2.2.2/ 的内容替换为步骤 2 中的 repo 的内容对我不起作用。要是真的就好了...
于 2013-02-23T16:39:59.810 回答