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

The command 'rake version' (and the other tasks related with version) raise ActiveRecord::ConnectionNotEstablished exception #19

Closed
maxidr opened this issue Jan 2, 2013 · 4 comments

Comments

@maxidr
Copy link

maxidr commented Jan 2, 2013

Hi!, I have a recently problem with the gem (I don't know what change broke this). When try to run any task related with version gem seem to try connect to the database (bizarre!)

This is the result when execute rake version --trace

** Invoke version (first_time)
** Invoke VERSION (first_time, not_needed)
** Execute version
rake aborted!
ActiveRecord::ConnectionNotEstablished
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/base.rb:685:in `columns'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/base.rb:693:in `columns_hash'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/attribute_methods.rb:13:in `define_attribute_methods'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.0.17/lib/active_record/attribute_methods.rb:51:in `respond_to?'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/version-1.0.0/lib/rake/version_task.rb:63:in `puts'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/version-1.0.0/lib/rake/version_task.rb:63:in `puts'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/version-1.0.0/lib/rake/version_task.rb:63:in `block in define'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/home/maxi/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load'
/home/maxi/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>'
Tasks: TOP => version

And my bundle list:

Gems included by the bundle:
  * Ascii85 (1.0.2)
  * abstract (1.0.0)
  * actionmailer (3.0.17)
  * actionpack (3.0.17)
  * activemodel (3.0.17)
  * activerecord (3.0.17)
  * activeresource (3.0.17)
  * activesupport (3.0.17)
  * addressable (2.3.2)
  * afipws (0.1.8)
  * annotate (2.5.0)
  * arel (2.0.10)
  * attrtastic (0.4.3)
  * aws-s3 (0.6.3)
  * aws-sdk (1.7.1)
  * bcrypt-ruby (3.0.1)
  * bourne (1.1.2)
  * builder (2.1.2)
  * bundler (1.2.2)
  * cancan (1.6.8)
  * capybara (2.0.1)
  * childprocess (0.3.6)
  * chunky_png (1.2.6)
  * cocaine (0.4.2)
  * cocoon (1.0.22)
  * coderay (1.0.8)
  * compass (0.12.2)
  * compass-rails (1.0.3)
  * crack (0.1.8)
  * daemons (1.1.9)
  * dalli (2.6.0)
  * devise (1.5.3)
  * devise_invitable (0.6.0)
  * diff-lcs (1.1.3)
  * erubis (2.6.6)
  * escape_utils (0.2.4)
  * eventmachine (1.0.0)
  * factory_girl (4.1.0)
  * factory_girl_rails (4.1.0)
  * ffi (1.2.0)
  * formtastic (2.0.2)
  * fssm (0.2.9)
  * geocoder (1.1.5)
  * guard (1.5.4)
  * guard-rspec (2.3.1)
  * gyoku (1.0.0)
  * haml (3.1.7)
  * haml-rails (0.3.4)
  * hashery (2.1.0)
  * hpricot (0.8.6)
  * httparty (0.9.0)
  * httpclient (2.3.0.1)
  * httpi (2.0.0)
  * i18n (0.5.0)
  * jquery-rails (2.1.4)
  * json (1.7.5)
  * kaminari (0.14.1)
  * libwebsocket (0.1.7.1)
  * listen (0.6.0)
  * lumberjack (1.0.2)
  * mail (2.2.19)
  * meta_search (1.0.6)
  * meta_where (1.0.4)
  * metaclass (0.0.1)
  * method_source (0.8.1)
  * mime-types (1.19)
  * mocha (0.10.5)
  * multi_json (1.5.0)
  * multi_xml (0.5.1)
  * nested_set (1.7.1)
  * nokogiri (1.5.5)
  * orm_adapter (0.0.7)
  * paper_trail (2.6.4)
  * paperclip (2.8.0)
  * pdf-reader (1.2.0)
  * pg (0.14.1)
  * polyglot (0.3.3)
  * prawn (0.12.0)
  * pry (0.9.10)
  * rack (1.2.5)
  * rack-mount (0.6.14)
  * rack-test (0.5.7)
  * rails (3.0.17)
  * railties (3.0.17)
  * rake (10.0.3)
  * rdoc (3.12)
  * rspec (2.12.0)
  * rspec-core (2.12.2)
  * rspec-expectations (2.12.1)
  * rspec-mocks (2.12.0)
  * rspec-rails (2.12.0)
  * ruby-ole (1.2.11.6)
  * ruby-rc4 (0.1.5)
  * rubyzip (0.9.9)
  * sass (3.2.3)
  * savon (0.8.3)
  * selenium-webdriver (2.27.2)
  * shoulda-matchers (1.4.2)
  * slop (3.3.3)
  * spreadsheet (0.7.5)
  * test-unit (2.5.3)
  * thin (1.5.0)
  * thor (0.14.6)
  * treetop (1.4.12)
  * ttfunk (1.0.3)
  * tzinfo (0.3.35)
  * uuidtools (2.1.3)
  * version (1.0.0)
  * warden (1.2.1)
  * webrat (0.7.3)
  * websocket (1.0.4)
  * wicked_pdf (0.8.0)
  * xml-simple (1.1.2)
  * xpath (1.0.0)

can you help me with this?

Thanks!!!

@maxidr
Copy link
Author

maxidr commented Jan 2, 2013

Mmmmm I think I found the problem...
Someone added the gem PaperTrail that add a model called Version :(
When call Version.some use the model instead the version class from your gem.

@stouset
Copy link
Owner

stouset commented Jan 2, 2013

Unfortunately, there's nothing I can do about this. Please contact the maintainer of PaperTrail to ensure they properly namespace their classes.

@stouset stouset closed this as completed Jan 2, 2013
@maxidr
Copy link
Author

maxidr commented Jan 2, 2013

You are right!, sorry for the misunderstanding

@stouset
Copy link
Owner

stouset commented Jan 2, 2013

No worries. It seems they already have an issue open for exactly this, but are waiting for version 3 to deploy a fix, which is regrettable but understandable. In the meantime, you could probably solve the issue with a small bit of monkeypatching to namespace the class yourself.

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

2 participants