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

undefined method `clear?' #65

Closed
YoranBrondsema opened this issue Dec 29, 2013 · 3 comments
Closed

undefined method `clear?' #65

YoranBrondsema opened this issue Dec 29, 2013 · 3 comments

Comments

@YoranBrondsema
Copy link

Hi,

I'm having this problem when I run ERD as a rake task in a Rails project. Running erd works fine, it generates the correct erd.pdf. However, when I run rake erd it exits with the following exception:

yoran@linux-854r:~/Projects/hstry-ed> rake erd --trace
** Invoke erd (first_time)
** Invoke erd:generate (first_time)
** Invoke erd:options (first_time)
** Execute erd:options
** Invoke erd:load_models (first_time)
** Execute erd:load_models
Loading application environment...
** Invoke environment (first_time)
** Invoke rails_admin:disable_initializer (first_time)
** Execute rails_admin:disable_initializer
[RailsAdmin] RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it.
** Execute environment
Loading code in search of Active Record models...
** Execute erd:generate
Generating Entity-Relationship Diagram for 25 models...
rake aborted!
undefined method `clear?' for #<RailsERD::Domain::Attribute:0x000000073049c0>
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:180:in `block (2 levels) in filtered_attributes'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:180:in `each'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:180:in `none?'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:180:in `block in filtered_attributes'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:177:in `reject'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:177:in `filtered_attributes'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:129:in `block in generate'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:128:in `each'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:128:in `generate'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:119:in `create'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/diagram.rb:74:in `create'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rails-erd-1.1.0/lib/rails_erd/tasks.rake:41:in `block (2 levels) in <top (required)>'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/yoran/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:197:in `block in invoke_prerequisites'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:195:in `each'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:195:in `invoke_prerequisites'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:174:in `block in invoke_with_call_chain'
/home/yoran/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/bin/rake:23:in `load'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/bin/rake:23:in `<main>'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/bin/ruby_executable_hooks:15:in `eval'
/home/yoran/.rvm/gems/ruby-2.0.0-p353@hstryed/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => erd => erd:generate

The weird thing is that it used to work until a few commits ago. I went over the commits and I saw that I only changed one model class. I reverted the change to that model class and it still gives the same error. ERD only scans the models right?

@msokk
Copy link

msokk commented Feb 6, 2014

Do you have i18n-tasks in Gemfile? If so, try without it.
i18n-tasks has term-ansicolor dependency. Both rails-erd and term-ansicolor have Attribute class, which somehow gets mixed up with rails-erd.

@bf4
Copy link
Collaborator

bf4 commented Sep 4, 2014

Is this still a problem?

@YoranBrondsema
Copy link
Author

Sorry for the late reply. i18n-tasks must have been it because I was actually using it. Now I'm not anymore and rails-erd works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants