Gettings Rails3, CouchDB, and RSpec to Play Nice

Spent the better part of 3 hours trying to get this to finally work.  I’m using:

gem ‘couchrest’
gem ‘couchrest_model’
gem ‘rspec-rails’
gem ‘rspec’

Simply running the regular bundle exec spec spec would always throw the error:

database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)

This seemed simple enough to me…ActiveRecord is still being called somewhere even though I’m trying to use CouchRest and CouchRest_Model.

First things first, you need to get ActiveRecord out of your Rails app. Hit up config/application.rb and comment out

require ‘rails/all’

and add the following:

require “action_controller/railtie”
require “action_mailer/railtie”
require “active_resource/railtie”
require “active_model/railtie”
require “rails/test_unit/railtie”

With that done, running spec will get you a different error, undefined method `fixture_path=’ for # (NoMethodError). Fix #2: Open up spec/spec_helper.rb and comment out the lines:

config.use_transactional_fixtures = true
config.fixture_path = “#{::Rails.root}/spec/fixtures”

Run rspec and watch those reds and greens go!

The AngryBird war is over!

The AngryBird war is over!

Christmas present from Holly. Tickets to the LA Ruby Conf!

Christmas present from Holly. Tickets to the LA Ruby Conf!

[Flash 10 is required to watch video]

Emma pig vs Angry bird

My wine collection is getting respectable again (Taken with instagram)

My wine collection is getting respectable again (Taken with instagram)

Vicious pig attack! (Taken with instagram)

Vicious pig attack! (Taken with instagram)

Rainn Wilson & Friends (Taken with instagram)

Rainn Wilson & Friends (Taken with instagram)

It’s my pig in a box!

I just nostalgia’d all over myself

I just nostalgia’d all over myself

3 of 281
Themed by: Hunson