Exception encountered: #<ActiveRecord::AdapterNotSpecified: test database is not configured> #47

Open
thibaudgg opened this Issue Sep 13, 2010 · 6 comments

Projects

None yet

4 participants

@thibaudgg

Hi Tim, very happy to see the 0.9.0.rc gem!

I got this exception when running my spec (2.0.0.beta.22) with --drb (without spec running fine):

Exception encountered: #<ActiveRecord::AdapterNotSpecified: test database is not configured>
backtrace:
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/activerecord-3.0.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/app_framework/rails.rb:57:in `preload_rails'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `call'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `exec_each_run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `each'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork.rb:74:in `exec_each_run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:12:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:21:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:18:in `fork'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/forker.rb:18:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:47:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `__send__'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `perform_without_block'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1518:in `perform'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1592:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1433:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1350:in `initialize'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `new'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `start_service'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:29:in `listen'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/lib/spork/server.rb:20:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork/runner.rb:76:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/../lib/spork/runner.rb:10:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc/bin/spork:10
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19:in `load'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19

Here my spork --d:

Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
- Spork Diagnosis -
-- Summary --
config/application.rb
config/boot.rb
spec/spec_helper.rb
-- Detail --
--- config/application.rb ---
--- config/boot.rb ---
--- spec/spec_helper.rb ---

Any ideas? Thanks!

@timcharper
sporkrb member

I've got one idea at least. Try 0.9.0 rc2 and let me know if you still get this.

@thibaudgg

Now I have another exception with the rc2:

Exception encountered: #<NameError: uninitialized constant User>
backtrace:
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-expectations-2.0.0.beta.22/lib/rspec/expectations/backward_compatibility.rb:6:in `const_missing'
/Users/Thibaud/Development/Code/Jilion/Products/SublimeVideo/my.sublimevideo.net/spec/models/user_spec.rb:58
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in `load_spec_files'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in `map'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/configuration.rb:308:in `load_spec_files'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/core/command_line.rb:18:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/rspec-core-2.0.0.beta.22/lib/rspec/monkey/spork/test_framework/rspec.rb:4:in `run_tests'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/forking.rb:13:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/magazine/../../../spork/forker.rb:21:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/magazine/../../../spork/forker.rb:18:in `fork'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/magazine/../../../spork/forker.rb:18:in `initialize'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/server.rb:47:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `__send__'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1558:in `perform_without_block'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1518:in `perform'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1592:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1588:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1584:in `main_loop'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1433:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `start'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1430:in `run'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1350:in `initialize'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `new'
/Users/Thibaud/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/1.8/drb/drb.rb:1630:in `start_service'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/server.rb:29:in `listen'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/lib/spork/server.rb:20:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/bin/../lib/spork/runner.rb:75:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/bin/../lib/spork/runner.rb:10:in `run'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/gems/spork-0.9.0.rc2/bin/spork:10
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19:in `load'
/Users/Thibaud/.rvm/gems/ree-1.8.7-2010.02/bin/spork:19
@kbjerring

Hey Thibaud. I've got exactly the same problem and error messages as you - both with spork 0.9.0.rc, and with 0.9.0.rc2. But I have no solution :(

@thibaudgg

Sadly, I still got this problem. Tim any ideas to fix this? I really want to use Spork with Rails3 :-)

@Metallord

This still happens for me on rc9. I'm using Ruby 1.9.2p290. I use Devise for my User model and I am doing what the wiki says about trapping Rails::Application::RoutesReloader.reload!. However if I remove that bit from the prefork it complains about undefined constant AlphabeticallyFirstHelper, so it seems to not load some bits of the application. I tested this on rails 3.1.0 and 3.1.1.rc1.

This may be related to issue #141

@Metallord

Also related to issue #66. Removing config.threadsafe! from application.rb helped, but this is just a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment