Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
ianneub opened this Issue · 8 comments

5 participants

@ianneub

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:in
block (3 levels) in '
/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:in
block 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:in
execute'
/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:in
mon_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:in
block 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:in
invoke_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:in
mon_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:in
invoke'
/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:in
block (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:in
block 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:in
top_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:in
standard_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
'
/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
@karmi
Owner

Yeah, thanks for the report, fixed!

@sr3d

@karmi has the gem been updated?

@karmi
Owner

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

@MrRuru MrRuru referenced this issue from a commit in jobteaser/tire
@karmi [FIX] Added missing require of ANSI::Progressbar in tasks
Closes #688
fdd72c8
@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:in
call'
/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:in
each'
/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:in
block 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:in
invoke_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:in
each'
/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:in
block 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:in
invoke_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:in
invoke_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:in
each'
/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:in
run_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:in
block 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:in
run'
/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:in
load'
/home/vagrant/.rbenv/versions/1.9.3-p194/bin/rake:23:in `

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

@karmi
Owner

@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

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 referenced this issue from a commit
@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
Something went wrong with that request. Please try again.