more icon indicating copy to clipboard operation
more copied to clipboard

Rails 3 Support

Open soffes opened this issue 15 years ago • 7 comments

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
  ...

soffes avatar Jan 02 '10 22:01 soffes

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.

KieranP avatar Feb 13 '10 19:02 KieranP

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

augustl avatar Feb 13 '10 20:02 augustl

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

KieranP avatar Feb 14 '10 01:02 KieranP

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'".

fortuity avatar Jun 27 '10 22:06 fortuity

@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

KieranP avatar Jun 27 '10 22:06 KieranP

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.

bjorntrondsen avatar Jan 18 '11 19:01 bjorntrondsen

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

marioestrada avatar Jun 03 '11 16:06 marioestrada