Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 4.0 Spork/ActiveRecord exception
    text
    copied!<p>I've been using Michael Hartl's <a href="http://ruby.railstutorial.org/" rel="noreferrer">Rails Tutorial</a> to pick up Ruby on Rails and have recently been going through the new Rails 4.0 version of the tutorial. I've encountered an issue with Spork; I know that we're using a custom fork of Spork for Rails 4.0 compatibility, and that this may just be a different incompatibility, but I wanted to post my issue and see if I was just doing something wrong or if anyone had any ideas. Whenever I call RSpec while Spork is running I get an ActiveRecord exception, while if I call RSpec by itself my tests run successfully - an example terminal dump is below:</p> <pre><code>oren@VM:~/ruby_projects/test_app$ rspec Exception encountered: #&lt;ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished&gt; backtrace: /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:79:in `retrieve_connection' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/connection_handling.rb:53:in `connection' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/migration.rb:792:in `current_version' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/migration.rb:800:in `needs_migration?' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activerecord-4.0.0/lib/active_record/migration.rb:379:in `check_pending!' /home/oren/ruby_projects/test_app/spec/spec_helper.rb:105:in `&lt;top (required)&gt;' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:11:in `block in run' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/forker.rb:21:in `block in initialize' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/forker.rb:18:in `fork' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/forker.rb:18:in `initialize' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in `new' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/run_strategy/forking.rb:9:in `run' /home/oren/.rvm/gems/ruby-2.0.0-p195@rails_4_0/gems/spork-1.0.0rc3/lib/spork/server.rb:48:in `run' /home/oren/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:1588:in `perform_without_block' /home/oren/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:1548:in `perform' /home/oren/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:1626:in `block (2 levels) in main_loop' /home/oren/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:1622:in `loop' /home/oren/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/drb/drb.rb:1622:in `block in main_loop' </code></pre> <p>I can provide any files from my app upon request, I'm just not sure what would be the most useful. I basically followed the first few steps of Chapter 3 of the tutorial (setting up new app, adding StaticPages controller, setting up RSpec, and adding the first spec) and the instructions for setting up Guard and Spork (Sec. 3.6.2 and 3.6.3).</p> <p>Thanks for your help!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload