Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage outside rails - Sinatra/ActiveRecord #199

Closed
ktaragorn opened this issue Jul 10, 2014 · 1 comment
Closed

Usage outside rails - Sinatra/ActiveRecord #199

ktaragorn opened this issue Jul 10, 2014 · 1 comment
Labels

Comments

@ktaragorn
Copy link

I copied the auto_annotate_models.rake file from a rails project, over to our sinatra app, set the model_dir in it to app/rds_models and tried annotate and annotate --model-dir app/rds_models. Both of these led to

I, [2014-07-10T15:18:34.444536 #5473]  INFO -- : development
/Users/karthikt/.rvm/gems/ruby-2.1.2/gems/annotate-2.6.5/lib/annotate.rb:100:in `eager_load': undefined method `version' for Rails:Module (NoMethodError)
        from /Users/karthikt/.rvm/gems/ruby-2.1.2/gems/annotate-2.6.5/bin/annotate:155:in `<top (required)>'
        from /Users/karthikt/.rvm/gems/ruby-2.1.2/bin/annotate:23:in `load'
        from /Users/karthikt/.rvm/gems/ruby-2.1.2/bin/annotate:23:in `<main>'
        from /Users/karthikt/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
        from /Users/karthikt/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'

I had to do model_dir=app/rds_models rake annotate_models to finally get it working. This is from going through the code, and seeing the ENV[] values being used to initialize the options.

@ctran ctran added feature and removed feature labels Aug 5, 2014
@betesh
Copy link

betesh commented Feb 24, 2015

👍

I suspect I'm having the same problem. When I run annotate --model-dir=lib/models in a sinatra app, I get:

.../annotate-2.6.5/lib/annotate.rb:142:in `block in fallback': undefined method `blank?' for nil:NilClass (NoMethodError)

@ctran ctran closed this as completed Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants