未初始化的常量Less :: Engine

时间:2011-08-19 22:10:15

标签: ruby-on-rails css ruby-on-rails-3 less

我正在尝试在我的系统上运行Less并运行,但是我遇到了错误。

到目前为止采取的步骤

gem install less
rails plugin install git://github.com/cloudhead/more.git
# restart everything
# moved styles.css to app/stylesheets/styles.less
rake more:generate

希望运行最后一行将在。{1}}中从.less源创建styles.css。但是,我收到错误:

public/stylesheets

发生了什么事?

设定:

Generating css from less files in app/stylesheets.
rake aborted!
uninitialized constant Less::Engine
From /Users/sanj/Documents/sanj/applyco/app/stylesheets/my_formtastic_changes.less
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `block in compile'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `open'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:122:in `compile'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:62:in `generate'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:77:in `block in generate_all'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:76:in `each'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/less/more.rb:76:in `generate_all'
/Users/sanj/Documents/sanj/applyco/vendor/plugins/more/lib/tasks/more_tasks.rake:5:in `block (2 levels) in <top (required)>'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/Users/sanj/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `load'
/Users/sanj/.rvm/gems/ruby-1.9.2-p0/bin/rake:19:in `<main>'

1 个答案:

答案 0 :(得分:3)

好看它this line更多是在调用engine = File.open(file){|f| Less::Engine.new(f) }并查看old code they do define the Less::Engine中的Less项目的源代码时导致错误但是他们已将gem移到了new version已包含对源的一些更改,但未定义Less :: Engine。

我建议您按照official less website上的说明启动并运行。似乎不再支持more插件。