Thor: No '<=' Method #255

Closed
trvrplk opened this Issue Sep 18, 2012 · 8 comments

Projects

None yet

2 participants

@trvrplk
trvrplk commented Sep 18, 2012

I ran a Rails generator I made, and it said:

/Users/myface13214/.rvm/gems/ruby-1.9.3-p194@193/gems/thor-0.16.0/lib/thor/invocation.rb:106:in `invoke': undefined method `<=' for nil:NilClass (NoMethodError)
@eventualbuddha
Contributor

Could you provide more information, perhaps the content of the generator? Even better would be a simplified test case that breaks as you describe. Please reopen when you provide this info. Thanks!

@trvrplk
trvrplk commented Sep 18, 2012

The method that seems to be causing this is the following:

def my_bloody_valentine_customiziation                                                                                                                                         
  say "Adding Custom Gems"                                                                                                                                                     
  invoke :add_custom_gems
end                                                                                                                                               
@eventualbuddha
Contributor

I'm not sure what in this could be causing problems. Perhaps try asking on stackoverflow.com and, if you discover the cause of this problem is within Thor itself, come back and reopen with steps to reproduce the problem. Thanks!

@trvrplk
trvrplk commented Sep 18, 2012

It doesn't seem to be a problem in the code, however further inspection of the log shows this may be caused by thor:

from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
        from /Users/myface13214/Code/Ruby/my_bloody_valentine/bin/val:14:in `<top (required)>'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/bin/val:19:in `load'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/bin/val:19:in `<main>'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
        from /Users/myface13214/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

Also, I can't reopen it, I don't have commit access.

@eventualbuddha
Contributor

Oh, I didn't know. Sorry about that. Please post your bin/val file, editing it if necessary (please check that the edited version still breaks) and let us know what we need to do to run it.

@trvrplk
trvrplk commented Sep 18, 2012

Here is bin/val:

#! /usr/bin/env ruby


require File.expand_path(File.join('..', 'lib', 'my_bloody_valentine', 'generators', 'app_generator'), File.dirname(__FILE__))
require File.expand_path(File.join('..', 'lib', 'my_bloody_valentine', 'app_builder'), File.dirname(__FILE__))

# Template stuff

templates_root = File.expand_path(File.join("..", "templates"), File.dirname(__FILE__))
MyBloodyValentine::AppGenerator.source_root templates_root
MyBloodyValentine::AppGenerator.source_paths << Rails::Generators::AppGenerator.source_root << templates_root

# Other stuff

MyBloodyValentine::AppGenerator.start
@eventualbuddha
Contributor

Wow, okay so it's not simple. I think this is too much for me to go through. If you can post all the code, perhaps try stackoverflow like I suggested. If you can come up with a small reproducible test case, please comment here again and I'll reopen.

@trvrplk
trvrplk commented Sep 19, 2012

Here's the repo:

https://github.com/cookiebatch/my_bloody_valentine

Ignore the directories that don't make sense (ffff, crap, etc), I was seeing if I got Thor to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment