GithubHelp home page GithubHelp logo

Comments (14)

theyagarajan avatar theyagarajan commented on June 14, 2024

I'm having the same error too!

from delayed_job_active_record.

amitsaxena avatar amitsaxena commented on June 14, 2024

I am also having the same issue and have verified that the error goes away when I remove "gem 'delayed_job_active_record'" from the Gemfile.

ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-linux]
Rails 3.0.0
delayed_job (3.0.0)
delayed_job_active_record (0.3.1)

trace:
$script/rails generate delayed_job:active_record --trace
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:318:in retrieve_connection': ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished) from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:inretrieve_connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in connection' from /usr/lib/ruby/gems/1.8/gems/arel-1.0.1/lib/arel/engines/sql/engine.rb:9:inconnection'
from /usr/lib/ruby/gems/1.8/gems/arel-1.0.1/lib/arel/engines/sql/relations/table.rb:37:in initialize' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:850:innew'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:850:in arel_table' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:896:inrelation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/named_scope.rb:32:in scoped' from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0/lib/active_record/base.rb:441:inorder'
from /usr/lib/ruby/gems/1.8/gems/delayed_job_active_record-0.3.1/lib/delayed/backend/active_record.rb:25
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:innew_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
from /usr/lib/ruby/gems/1.8/gems/delayed_job_active_record-0.3.1/lib/delayed_job_active_record.rb:3
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in require' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:inrequire'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:inrequire'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in each' from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:inrequire'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler.rb:122:in require' from <RAILS_ROOT>/config/application.rb:6 from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/commands.rb:15:inrequire'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/commands.rb:15
from script/rails:6:in `require'
from script/rails:6

from delayed_job_active_record.

pcreux avatar pcreux commented on June 14, 2024

Same issue here with delayed_job_active_record 0.3.2. (Rails 3.0.0 on ree.)

from delayed_job_active_record.

pcreux avatar pcreux commented on June 14, 2024

@nessence Which version of rails are you running?

from delayed_job_active_record.

nessence avatar nessence commented on June 14, 2024

@pcreux 3.0.0

from delayed_job_active_record.

tehtorq avatar tehtorq commented on June 14, 2024

Could this be related to rails/rails#783 ?

from delayed_job_active_record.

vida avatar vida commented on June 14, 2024

I'm having this problem too - has anyone solved this?

from delayed_job_active_record.

guiocavalcanti avatar guiocavalcanti commented on June 14, 2024

+1

from delayed_job_active_record.

guiocavalcanti avatar guiocavalcanti commented on June 14, 2024

This is an Rails 3 ActiveRecord problem as reported on this issue. To sum it up, AR tries to validate the scope at require time, which doesn't make any sense because there is no connection established yet.

The simple workaround is to define the scope inside a class method in order to delay it's validation to runtime. I'll submit a patch to solve this problem.

from delayed_job_active_record.

rpk avatar rpk commented on June 14, 2024

Is there a workaround for this issue we can use until a new gem is pushed? We're stuck on Rails 3.0.

from delayed_job_active_record.

sferik avatar sferik commented on June 14, 2024

@bryckbost is currently the only person who is authorized to push new delayed_job_active_record gems. (If Brian adds me as an owner, I'd be happy to build and push a new release for you.) In the mean time, you can update your Gemfile to fetch delayed_job_active_record from Git:

gem 'delayed_job_active_record', :git => 'git://github.com/collectiveidea/delayed_job_active_record.git'

from delayed_job_active_record.

ernsheong avatar ernsheong commented on June 14, 2024

This problem is still not fixed. @sferik's solution works though. however, replace it with the latest gem version breaks it

from delayed_job_active_record.

sferik avatar sferik commented on June 14, 2024

I'll push a new gem version this weekend.

from delayed_job_active_record.

sferik avatar sferik commented on June 14, 2024

Shiped it! :shipit:

from delayed_job_active_record.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.