Should my app be calling Dotenv.load when its running its test suite?
Without calling Dotenv.load while running my test suite, rspec fails with an error about missing an environment key. I have pasted the error and its stack trace below.
$ rspec
An error occurred while loading ./spec/requests/users/create_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)
KeyError:
key not found: "REDIS_URL"
# (erb):11:in `fetch'
# (erb):11:in `<main>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application.rb:233:in `config_for'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable/engine.rb:31:in `block (2 levels) in <class:Engine>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable/server/base.rb:85:in `<module:Server>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable/server/base.rb:4:in `<module:ActionCable>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable/server/base.rb:3:in `<top (required)>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable.rb:44:in `server'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actioncable-5.1.4/lib/action_cable/engine.rb:46:in `block (3 levels) in <class:Engine>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `instance_exec'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:426:in `eval_block'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:443:in `block in clear!'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:443:in `each'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/actionpack-5.1.4/lib/action_dispatch/routing/route_set.rb:443:in `clear!'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:50:in `block in clear!'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:48:in `each'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:48:in `clear!'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:17:in `reload!'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
# /Users/robskrob/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
# ./config/environment.rb:5:in `<top (required)>'
# ./spec/rails_helper.rb:4:in `require'
# ./spec/rails_helper.rb:4:in `<top (required)>'
# ./spec/requests/users/create_spec.rb:1:in `require'
# ./spec/requests/users/create_spec.rb:1:in `<top (required)>'
Outside of a Rails app you want to do the following:
require 'dotenv/tasks'
task start: [:dotenv] do
# this Rake tasks depends on the dotenv loading task
puts 'hi'
end
Inside a Rails app:
Since you're actually in a Rails app, I would make sure you're using dotenv-rails in your Gemfile, instead of just dotenv. The former will auto run the dotenv stuff as part of the Rails startup routine
Related
We have been using the default MongoDB version in our Travis builds, which is 3.2. After upgrading to MongoDB 3.4 (3.4.10) we have started seeing intermittent build failures:
An error occurred while loading ./spec/controllers/users_controller_spec.rb.
Failure/Error: require File.expand_path("../../config/environment", __FILE__)
Mongo::Error::OperationFailure:
Didn't find RecordId in WiredTigerRecordStore (28556)
# ./vendor/bundle/ruby/2.3.0/gems/mongo-2.4.3/lib/mongo/operation/result.rb:256:in `validate!'
# ./vendor/bundle/ruby/2.3.0/gems/mongo-2.4.3/lib/mongo/operation/write/write_command_enabled.rb:57:in `execute_write_command'
# ./vendor/bundle/ruby/2.3.0/gems/mongo-2.4.3/lib/mongo/operation/write/write_command_enabled.rb:41:in `execute'
# ./vendor/bundle/ruby/2.3.0/gems/mongo-2.4.3/lib/mongo/index/view.rb:159:in `create_many'
# ./vendor/bundle/ruby/2.3.0/gems/mongo-2.4.3/lib/mongo/index/view.rb:130:in `create_one'
# ./vendor/bundle/ruby/2.3.0/gems/mongoid-6.2.1/lib/mongoid/indexable.rb:38:in `block in create_indexes'
# ./vendor/bundle/ruby/2.3.0/gems/mongoid-6.2.1/lib/mongoid/indexable.rb:31:in `each'
# ./vendor/bundle/ruby/2.3.0/gems/mongoid-6.2.1/lib/mongoid/indexable.rb:31:in `create_indexes'
# ./config/application.rb:60:in `block (2 levels) in <class:Application>'
# ./config/application.rb:60:in `each'
# ./config/application.rb:60:in `block in <class:Application>'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:67:in `block in execute_hook'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:50:in `block in run_load_hooks'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `each'
# ./vendor/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:49:in `run_load_hooks'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:73:in `block in <module:Finisher>'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
# ./vendor/bundle/ruby/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
# ./config/environment.rb:5:in `<top (required)>'
# ./spec/rails_helper.rb:13:in `require'
# ./spec/rails_helper.rb:13:in `<top (required)>'
# ./spec/controllers/users_controller_spec.rb:1:in `require'
# ./spec/controllers/users_controller_spec.rb:1:in `<top (required)>'
In our application.rb (line number 60) we make sure that we create all the relevant MongoDB indexes:
User.create_indexes
Versions
MongoDB: 3.4.10
Ruby: 2.3.5 (MRI)
Rails: 5.1.4
Mongoid: 6.2.1 (mongo 2.3.4)
Travis build environment: Trusty (sudo-less)
Any ideas as to what might be causing this?
I have installed the Rspec and trying to run the first test for the models but I am getting this error
.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/generic.rb:214:in `initialize': the scheme redis does not accept registry part: : (or bad hostname?) (URI::InvalidURIError)
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/common.rb:218:in `new'
before the test starts running. I am using Redis and Sidekick in my project. Does anyone know how to get over this hump? Thanks
EDIT: full backtrace
ewamarciniak$ bundle exec rspec spec/models/message_spec.rb
/Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/bundler-1.7.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr in PATH, mode 040777
/Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/bundler-1.7.2/lib/bundler/runtime.rb:222: warning: Insecure world writable dir /usr in PATH, mode 040777
/Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/generic.rb:214:in `initialize': the scheme redis does not accept registry part: : (or bad hostname?) (URI::InvalidURIError)
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/common.rb:218:in `new'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/common.rb:218:in `parse'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/uri/common.rb:747:in `parse'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/sidekiq-3.3.0/lib/sidekiq/redis_connection.rb:60:in `log_info'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/sidekiq-3.3.0/lib/sidekiq/redis_connection.rb:19:in `create'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/sidekiq-3.3.0/lib/sidekiq.rb:83:in `redis='
from /Users/ewamarciniak/Documents/Projects/popdeem-server/config/initializers/sidekiq.rb:14:in `block in <top (required)>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/sidekiq-3.3.0/lib/sidekiq.rb:63:in `configure_client'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/config/initializers/sidekiq.rb:13:in `<top (required)>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:241:in `load'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:648:in `block in load_config_initializer'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb:161:in `instrument'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:647:in `load_config_initializer'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:612:in `block (2 levels) in <class:Engine>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:611:in `each'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:611:in `block in <class:Engine>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `each'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/ewamarciniak/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/application.rb:288:in `initialize!'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/config/environment.rb:5:in `<top (required)>'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/spec/rails_helper.rb:4:in `require'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/spec/rails_helper.rb:4:in `<top (required)>'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/spec/models/message_spec.rb:1:in `require'
from /Users/ewamarciniak/Documents/Projects/popdeem-server/spec/models/message_spec.rb:1:in `<top (required)>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/configuration.rb:1226:in `load'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/configuration.rb:1224:in `each'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:97:in `setup'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:85:in `run'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:70:in `run'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/lib/rspec/core/runner.rb:38:in `invoke'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.2.1/exe/rspec:4:in `<top (required)>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/bin/rspec:23:in `load'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/bin/rspec:23:in `<main>'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/ewamarciniak/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
EDIT: config/initializers/sidekiq.rb
rails_root = Rails.root || File.dirname(__FILE__) + '/../..'
rails_env = Rails.env || 'development'
redis_config = YAML.load_file(rails_root.to_s + '/config/redis.yml')
redis_config.merge! redis_config.fetch(Rails.env, {})
redis_config.symbolize_keys!
Sidekiq.configure_server do |config|
config.redis = { :url => "redis://#{redis_config[:host]}:#{redis_config[:port]}/12", :namespace => 'Sidekiq' }
end
Sidekiq.configure_client do |config|
config.redis = { :url => "redis://#{redis_config[:host]}:#{redis_config[:port]}/12", :namespace => 'Sidekiq' }
end
redis_config[:host] and redis_config[:port] is nil or empty. Seems like these configuration options is undefined in your config/redis.yml.
Have a basic helper test:
require 'rails_helper'
describe BuilderHelper do
...
describe 'press events classes' do
let(:account) { create(:candidate_profile).account }
before { allow_any_instance_of(Object).to receive(:current_account).and_return account }
specify do
expect_any_instance_of(PublicPage).to receive(:show_press?).and_return true
expect_any_instance_of(PublicPage).to receive(:show_events?).and_return true
expect(press_events_classes(account)).to eq 'section'
end
...
end
...
end
And it gives strange error:
Failure/Error: before { allow_any_instance_of(Object).to receive(:current_account).and_return account }
NoMethodError:
undefined method `unbind' for #<Proc:0x00000009803640>
# ./spec/helpers/builder_helper_spec.rb:27:in `block (3 levels) in <top (required)>'
# ./spec/support/vcr.rb:16:in `block (2 levels) in <top (required)>'
(that's it, that's the whole error log)
So the error is in before block.
The problem is that I don't have an "unbind" method anywhere.
I looked in Rails repo - it doesn't seem to have anything too.
Don't know what's the problem. Can anyone help where to look?
Update
Alright, thanks to comment I got this:
1) BuilderHelper press events classes
Failure/Error: before { allow_any_instance_of(Object).to receive(:current_account).and_return account }
NoMethodError:
undefined method `unbind' for #<Proc:0x000000025ff9e0>
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/proxy.rb:372:in `original_unbound_method_handle_from_ancestor_for'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/proxy.rb:355:in `original_method_handle_for'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/method_double.rb:28:in `original_method'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/method_double.rb:57:in `define_proxy_method'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/method_double.rb:50:in `configure_method'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/method_double.rb:150:in `add_stub'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/proxy.rb:112:in `add_stub'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/any_instance/proxy.rb:38:in `block in stub'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/any_instance/proxy.rb:81:in `map'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/any_instance/proxy.rb:81:in `perform_proxying'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/any_instance/proxy.rb:37:in `stub'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/matchers/receive.rb:88:in `setup_method_substitute'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/matchers/receive.rb:81:in `setup_any_instance_method_substitute'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/matchers/receive.rb:49:in `setup_any_instance_allowance'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/targets.rb:45:in `define_matcher'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-mocks-3.0.4/lib/rspec/mocks/targets.rb:14:in `block in delegate_to'
# ./spec/helpers/builder_helper_spec.rb:27:in `block (3 levels) in <top (required)>'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:349:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:410:in `block in run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:410:in `each'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:410:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:485:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:340:in `run_before_example'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:147:in `block in run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `call'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-rails-3.0.2/lib/rspec/rails/adapters.rb:72:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:430:in `block (2 levels) in run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `call'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# ./spec/support/vcr.rb:16:in `block (2 levels) in <top (required)>'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:294:in `instance_exec'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:430:in `block (2 levels) in run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `call'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:432:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/hooks.rb:485:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:303:in `with_around_example_hooks'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:145:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:494:in `block in run_examples'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:490:in `map'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:490:in `run_examples'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:457:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:458:in `block in run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:458:in `map'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:458:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `map'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `block in run_specs'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:54:in `report'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:108:in `run_specs'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:86:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
# /home/dell/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
# /home/dell/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `load'
# /home/dell/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `<main>'
# /home/dell/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
# /home/dell/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Still not sure what to do.
Update
Solved by replacing this:
before { allow_any_instance_of(Object).to receive(:current_account).and_return account }
With this:
before { allow_any_instance_of(BuilderHelper).to receive(:current_account).and_return account }
So my best guess which is hard to tell base on this but what I had happen was I in fact stubbed out the find and returned a proc object in its place.
let(:record) { create :record } # This is a Proc
allow(Object).to receive(:find).and_return(record)
allow_any_instance_of(Object).to receive(:update) # This calls unbind
Sadly trying to figure out where the first stub happened. But I bet it is there in your code.
I try to integrate piggybak in my rails application, using the example initializer for rails_admin from
https://github.com/piggybak/demo/blob/master/config/initializers/rails_admin.rb
When I try to start up the server I get the following error:
/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in block (2 levels) in <top (required)>': undefined methodnestable' for RailsAdmin::Config::Actions:Module (NoMethodError)
This is the server log:
/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in `block (2 levels) in <top (required)>': undefined method `nestable' for RailsAdmin::Config::Actions:Module (NoMethodError)
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `instance_eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `actions'
from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:21:in `block in <top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `call'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `config'
from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:1:in `<top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/dumand/Desktop/Projects/3dgreen/config/environment.rb:5:in `<top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:3:in `block in <main>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `new'
from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `<main>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
and here is rails_admin initializer:
RailsAdmin.config do |config|
config.main_app_name = ["3D Green"]
### Popular gems integration
## == Devise ==
# config.authenticate_with do
# warden.authenticate! scope: :user
# end
# config.current_user_method(&:current_user)
## == Cancan ==
# config.authorize_with :cancan
## == PaperTrail ==
# config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0
### More at https://github.com/sferik/rails_admin/wiki/Base-configuration
config.actions do
dashboard # mandatory
index # mandatory
new
export
bulk_delete
show
edit
delete
show_in_app
nestable do
visible do
[::PiggybakTaxonomy::NavigationNode].include? bindings[:abstract_model].model
end
end
## With an audit adapter, you can add:
# history_index
# history_show
config.model Product do
edit do
include_all_fields
end
end
end
end
Try it with removing nestable taxanomy code because it seems that you didn't uses nested taxanomy as per your models also
I started randomly getting the following stack trace in my project on this repo when running tests. My buddy forked and cloned and he doesn't get the error. I also have other projects that call the deliveries method and they have no problems. I have tried deleting the file and re cloning and it still doesn't work. I honestly have no idea where to start. Any help would be greatly appreciated.
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
undefined method `deliveries' for ActionMailer::Base:Class
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/actionmailer-4.1.1/lib/action_mailer/base.rb:553:in `method_missing'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/actionmailer-4.1.1/lib/action_mailer/test_case.rb:59:in `initialize_test_deliveries'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-rails-3.0.1/lib/rspec/rails/adapters.rb:109:in `block (2 levels) in setup'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:349:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:410:in `block in run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:410:in `each'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:410:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:485:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:340:in `run_before_example'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:147:in `block in run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:210:in `call'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-rails-3.0.1/lib/rspec/rails/adapters.rb:68:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:430:in `block (2 levels) in run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:210:in `call'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:432:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/hooks.rb:485:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:303:in `with_around_example_hooks'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example.rb:145:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:494:in `block in run_examples'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:490:in `map'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:490:in `run_examples'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:457:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:458:in `block in run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:458:in `map'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/example_group.rb:458:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:112:in `map'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:112:in `block in run_specs'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/reporter.rb:54:in `report'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:108:in `run_specs'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:86:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:70:in `run'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:38:in `invoke'
# /Users/Evan/.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/exe/rspec:4:in `<top (required)>'
# /Users/Evan/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `load'
# /Users/Evan/.rvm/gems/ruby-2.1.1/bin/rspec:23:in `<main>'
# /Users/Evan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
# /Users/Evan/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
#
# Showing full backtrace because every line was filtered out.
# See docs for RSpec::Configuration#backtrace_exclusion_patterns and
# RSpec::Configuration#backtrace_inclusion_patterns for more information.
Apparently the problem was my gemset. I am not sure how it happened because it was seemingly in the middle of writing code in a test but I installed a new gemset and all is good. Thanks for anyone who took the time to read this and or edit my post.