uninitialized constant Tire::Tasks::Import::ANSI #688

Closed
ianneub opened this Issue Mar 28, 2013 · 8 comments

Projects

None yet

5 participants

@ianneub
ianneub commented Mar 28, 2013

Howdy,

I'm just starting out with tire and elasticsearch. I get an error when I try to import some existing records (or replace them) using the rake task.

Seems to be related to the recent refactor? Any thoughts on what gem I might be missing?

I have ansi = 1.4.3 as part of the tire dependency, is that not enough?

Thanks for any help!

rake tire:import CLASS='Item' FORCE=true --trace

** Invoke tire:import (first_time)
** Invoke tire:import:model (first_time)
** Execute tire:import:model
[IMPORT] Rails detected, loading environment...
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Tire::Tasks::Import::ANSI
/opt/ruby/lib/ruby/gems/1.9.1/gems/tire-0.5.6/lib/tire/tasks.rb:40:in progress_bar' /opt/ruby/lib/ruby/gems/1.9.1/gems/tire-0.5.6/lib/tire/tasks.rb:113:inblock (3 levels) in <top (required)>'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in call' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:inblock in execute'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in each' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:inexecute'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:166:in block in invoke_with_call_chain' /opt/ruby/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in invoke_with_call_chain' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:187:inblock in invoke_prerequisites'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:in each' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:ininvoke_prerequisites'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:165:in block in invoke_with_call_chain' /opt/ruby/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:in invoke_with_call_chain' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:152:ininvoke'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:143:in invoke_task' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:inblock (2 levels) in top_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in each' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:inblock in top_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:110:in run_with_threads' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:95:intop_level'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:73:in block in run' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:instandard_exception_handling'
/opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in run' /opt/ruby/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in<top (required)>'
/opt/ruby/bin/rake:19:in load' /opt/ruby/bin/rake:19:in

'
Tasks: TOP => tire:import => tire:import:model

@thalesfp

To solve this I added "require 'ANSI'" after "require 'rake'" in tasks.rb (/opt/ruby/lib/ruby/gems/1.9.1/gems/tire-0.5.6/lib/tire/tasks.rb)

@karmi karmi closed this in 9ed1ff0 Mar 28, 2013
@karmi
Owner
karmi commented Mar 28, 2013

Yeah, thanks for the report, fixed!

@sr3d
sr3d commented Mar 29, 2013

@karmi has the gem been updated?

@karmi
Owner
karmi commented Mar 29, 2013

Not at Rubygems, will push a new minor version to avoid confusion.

@ichilton

I get this same error, and when i've checked tasks.rb, the change suggested above has already been made:

$ bundle exec rake environment tire:import --trace
** Invoke environment (first_time)
** Execute environment
** Invoke tire:import (first_time)
** Invoke tire:import:model (first_time)
** Execute tire:import:model
[IMPORT] Rails detected, loading environment...
** Invoke environment
rake aborted!
uninitialized constant HRULE
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/tire-0.5.7/lib/tire/tasks.rb:98:in block (3 levels) in <top (required)>' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:incall'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:228:in block in execute' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:ineach'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:223:in execute' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:166:inblock in invoke_with_call_chain'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:ininvoke_with_call_chain'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:187:in block in invoke_prerequisites' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:ineach'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:185:in invoke_prerequisites' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:165:inblock in invoke_with_call_chain'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in mon_synchronize' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:159:ininvoke_with_call_chain'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/task.rb:152:in invoke' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:143:ininvoke_task'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in block (2 levels) in top_level' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:ineach'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:101:in block in top_level' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:110:inrun_with_threads'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:95:in top_level' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:73:inblock in run'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in standard_exception_handling' /home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:inrun'
/home/vagrant/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in <top (required)>' /home/vagrant/.rbenv/versions/1.9.3-p194/bin/rake:23:inload'
/home/vagrant/.rbenv/versions/1.9.3-p194/bin/rake:23:in `

'
Tasks: TOP => tire:import => tire:import:model

@karmi
Owner
karmi commented May 14, 2013

@ichilton Is it solved for you then or do you still have the issue?

@ichilton

@karmi Still have the issue.

Although it seems to only happen if I just run:
bundle exec rake environment tire:import

I just tried specifying a class, like:
bundle exec rake environment tire:import CLASS='Article'

...and that seemed to work fine.

Thanks,

Ian

@karmi
Owner
karmi commented May 14, 2013

This is a different error, I see:

uninitialized constant HRULE

That is solved only in master, not in a release, will push out a version.

@karmi karmi added a commit that referenced this issue May 14, 2013
@karmi Release v0.5.8
Fixes: #688
ff36252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment