less / more

less on rails — the official LESS plugin for Ruby on Rails
http://lesscss.org
MIT License
226 stars 41 forks source link

Rails 3 Support #20

Open soffes opened 14 years ago

soffes commented 14 years ago

Currently, when you try to install more into a Rails 3 app, you get

Plugin not found: ["git://github.com/cloudhead/more.git"]

If you try to run script server, you get a NameError on the first request. Here's part of the stack:

/path/to/railsapp/vendor/plugins/more/rails/init.rb:3: undefined local variable or method `config' for main:Object (NameError)
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    from /path/to/railsapp/vendor/gems/dirs/rails/activesupport/lib/active_support/dependencies.rb:167:in `require'
    from /path/to/railsapp/vendor/gems/dirs/rails/activesupport/lib/active_support/dependencies.rb:537:in `new_constants_in'
    from /path/to/railsapp/vendor/gems/dirs/rails/activesupport/lib/active_support/dependencies.rb:167:in `require'
    from /path/to/railsapp/vendor/plugins/more/init.rb:1
  ...
KieranP commented 14 years ago

Additionally, treetop and polyglot are incompatible, and cause booting to fail completely, so patches will need to make it upstream to those projects before this plugin itself is compatible.

augustl commented 14 years ago

Odd, how can treetop and polygot affect Rails in any way?

KieranP commented 14 years ago

I didn't do deep investigations, but it looked like Polyglots redefine of Kernel#require had something to do with it.

fortuity commented 14 years ago

Fails with Rails 3 beta 4. Installed with "gem 'less'" in the Gemfile and ran "bundle install". Tried "rake more:generate" and got error "Don't know how to build task 'more:generate'".

KieranP commented 14 years ago

@fortuity: Have a look at less.js. I've got it working nicely with Rails 3 because it doesn't actually use Ruby, and it's very fast. http://github.com/cloudhead/less.js

bjorntrondsen commented 13 years ago

It seems to be working just fine in Rails 3.0.3 for me. All I did was: Add "gem 'less'" to the gemfile bundle install rails plugin install git://github.com/cloudhead/more.git Then I added a file to config/initializers for the configuration (for stuff like Less::More.source_path). This shouldnt be needed if you're fine with the default configuration.

marioestrada commented 13 years ago

Check this less-js gem for working with the JS version of Less: https://github.com/thisduck/ruby-less-js