I am currently running rspec with rails 4.1.1 and ruby 2.1.1 however I'm getting a bunch of errors related to gems and such with out it even getting to the models.
This is a new version of rspec that has a spec_helper.rb as well as a rails_helper.rb
You require the rails_helper.rb in your spec with that file subsequently referencing the spec_helper.rb
I haven't made any changes to the two helper files and have just gotten started with my project. Any assistance/information would be greatly appreciated!
$ bundle exec rspec
/.rvm/gems/ruby-2.1.1/gems/simplecov-html-0.8.0/lib/simplecov-html.rb:58: warning: possibly useless use of a variable in void context
/.rvm/gems/ruby-2.1.1/gems/gibbon-1.1.3/lib/gibbon/api_category.rb:75: warning: method redefined; discarding old api_key=
/.rvm/gems/ruby-2.1.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:71: warning: shadowing outer local variable - logger
/.rvm/gems/ruby-2.1.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:174: warning: assigned but unused variable - x_origin
/.rvm/gems/ruby-2.1.1/gems/stripe-1.14.0/lib/stripe.rb:172: warning: assigned but unused variable - ex
/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/exceptions.rb:157: warning: assigned but unused variable - message
/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/exceptions.rb:167: warning: assigned but unused variable - message
/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/response.rb:11: warning: method redefined; discarding old body
/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/payload.rb:47: warning: mismatched indentations at 'end' with 'case' at 40
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/proxy.rb:72: warning: assigned but unused variable - opts
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/proxy.rb:104: warning: assigned but unused variable - opts
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/manager.rb:22: warning: `*' interpreted as argument prefix
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double.rb:50: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double.rb:50: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double.rb:50: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double.rb:50: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double_collection.rb:42: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/double_collection.rb:42: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/object_double.rb:28: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/proxy_implementation.rb:26: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/doublespeak/stub_implementation.rb:30: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher.rb:89: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb:30: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/independent/delegate_matcher/stubbed_target.rb:30: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/allow_value_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/disallow_value_matcher.rb:51: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_model/have_secure_password_matcher.rb:52: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matcher.rb:204: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/counter_cache_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/inverse_of_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/order_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb:53: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb:53: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/through_matcher.rb:53: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/dependent_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/source_matcher.rb:31: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb:51: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/model_reflector.rb:51: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb:49: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/model_reflection.rb:49: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb:47: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/association_matchers/option_verifier.rb:47: warning: method redefined; discarding old reflector
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/active_record/have_db_column_matcher.rb:192: warning: assigned but unused variable - expected
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/route_params.rb:19: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb:41: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb:41: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb:41: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/rescue_from_matcher.rb:41: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/callback_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/callback_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/callback_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/callback_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/callback_matcher.rb:100: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/shoulda-matchers-2.6.1/lib/shoulda/matchers/action_controller/strong_parameters_matcher.rb:67: warning: private attribute?
/.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara/dsl.rb:1: warning: loading in progress, circular require considered harmful - /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara.rb
from /.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
from /.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /.rvm/gems/ruby-2.1.1/bin/rspec:23:in `<main>'
from /.rvm/gems/ruby-2.1.1/bin/rspec:23:in `load'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/exe/rspec:4:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:38:in `invoke'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:70:in `run'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:85:in `run'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:97:in `setup'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `load_spec_files'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `each'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `block in load_spec_files'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `load'
from /Desktop/winesimple_ecom/spec/models/factories_spec.rb:1:in `<top (required)>'
from /Desktop/winesimple_ecom/spec/models/factories_spec.rb:1:in `require'
from /Desktop/winesimple_ecom/spec/rails_helper.rb:7:in `<top (required)>'
from /Desktop/winesimple_ecom/spec/rails_helper.rb:7:in `require'
from /Desktop/winesimple_ecom/config/environment.rb:2:in `<top (required)>'
from /Desktop/winesimple_ecom/config/environment.rb:2:in `require'
from /Desktop/winesimple_ecom/config/application.rb:14:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler.rb:132:in `require'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `require'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:61:in `each'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `block in require'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:72:in `each'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /.rvm/gems/ruby-2.1.1#global/gems/bundler-1.6.1/lib/bundler/runtime.rb:76:in `require'
from /.rvm/gems/ruby-2.1.1/gems/capybara-webkit-1.1.1/lib/capybara-webkit.rb:1:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/capybara-webkit-1.1.1/lib/capybara-webkit.rb:1:in `require'
from /.rvm/gems/ruby-2.1.1/gems/capybara-webkit-1.1.1/lib/capybara/webkit.rb:1:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/capybara-webkit-1.1.1/lib/capybara/webkit.rb:1:in `require'
from /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara.rb:5:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara.rb:295:in `<module:Capybara>'
from /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara.rb:295:in `require'
from /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara/dsl.rb:1:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara/dsl.rb:1:in `require'
/.rvm/gems/ruby-2.1.1/gems/capybara-2.1.0/lib/capybara/selenium/driver.rb:109: warning: assigned but unused variable - a
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/manager.rb:72: warning: method redefined; discarding old serialize
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/session_serializer.rb:14: warning: previous definition of serialize was here
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/manager.rb:87: warning: method redefined; discarding old deserialize
/.rvm/gems/ruby-2.1.1/gems/warden-1.2.3/lib/warden/session_serializer.rb:18: warning: previous definition of deserialize was here
/.rvm/gems/ruby-2.1.1/gems/mail-2.5.4/lib/mail/network/delivery_methods/sendmail.rb:53: warning: shadowing outer local variable - to
/.rvm/gems/ruby-2.1.1/gems/factory_girl-4.4.0/lib/factory_girl/find_definitions.rb:16: warning: File.exists? is a deprecated name, use File.exist? instead
/.rvm/gems/ruby-2.1.1/gems/factory_girl-4.4.0/lib/factory_girl/find_definitions.rb:16: warning: File.exists? is a deprecated name, use File.exist? instead
/.rvm/gems/ruby-2.1.1/gems/factory_girl-4.4.0/lib/factory_girl/find_definitions.rb:16: warning: File.exists? is a deprecated name, use File.exist? instead
Coverage report generated for RSpec to /Desktop/winesimple_ecom/coverage. 76 / 113 LOC (67.26%) covered.
/.rvm/gems/ruby-2.1.1/gems/rspec-support-3.0.2/lib/rspec/support/version_checker.rb:28:in `raise_too_low_error': You are using capybara 2.1.0. RSpec requires version >= 2.2.0. (RSpec::Support::LibraryVersionTooLowError)
from /.rvm/gems/ruby-2.1.1/gems/rspec-support-3.0.2/lib/rspec/support/version_checker.rb:18:in `check_version!'
from /.rvm/gems/ruby-2.1.1/gems/rspec-rails-3.0.1/lib/rspec/rails/vendor/capybara.rb:13:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /.rvm/gems/ruby-2.1.1/gems/rspec-rails-3.0.1/lib/rspec/rails.rb:9:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
from /.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
from /Desktop/winesimple_ecom/spec/rails_helper.rb:8:in `<top (required)>'
from /Desktop/winesimple_ecom/spec/models/factories_spec.rb:1:in `require'
from /Desktop/winesimple_ecom/spec/models/factories_spec.rb:1:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `load'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `block in load_spec_files'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `each'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/configuration.rb:1057:in `load_spec_files'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:97:in `setup'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:85:in `run'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:70:in `run'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/lib/rspec/core/runner.rb:38:in `invoke'
from /.rvm/gems/ruby-2.1.1/gems/rspec-core-3.0.2/exe/rspec:4:in `<top (required)>'
from /.rvm/gems/ruby-2.1.1/bin/rspec:23:in `load'
from /.rvm/gems/ruby-2.1.1/bin/rspec:23:in `<main>'
from /.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
from /.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Found the reason why this happens here: https://stackoverflow.com/a/24005972/2491655
tl;dr - running $ rails g rspec:install now adds --warnings to the .rspec file in your root directory
Part of that output is warnings (perhaps you have warnings turned on in your .rspec)
In the middle of that is
support/version_checker.rb:28:in `raise_too_low_error': You are using capybara 2.1.0. RSpec requires version >= 2.2.0. (RSpec::Support::LibraryVersionTooLowError)
Since you are using rspec 3 you actually want capybara 2.3 - version 2.2 will work but you'll get warnings about deprecated matcher syntax.
Related
I'm wondering how I can go about something like this in the devise config.rb.
if request.subdomain == 'app'
config.case_insensitive_keys = [:username]
elsif request.subdomain == 'support'
config.case_insensitive_keys = [:email]
end
The use here is that I want system users to only be able to login with their employee_id's (username) because their email addresses can appear across multiple accounts so I needed a way to log them in and register without the devise email validations catching them, however I want the backend group to login only by email (me and future devs) as there should never be more than one user there with multiple emails
this is failing when I try to drop my database for some reason?
STACK TRACE
/Users/taurenltd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/taurenltd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here
rails aborted!
SyntaxError: /Users/taurenltd/Desktop/Development/roadze-base/config/initializers/devise.rb:301: syntax error, unexpected end-of-input, expecting `end'
/Users/taurenltd/Desktop/Development/roadze-base/config/environment.rb:5:in `<main>'
/Users/taurenltd/Desktop/Development/roadze-base/bin/rails:9:in `<top (required)>'
/Users/taurenltd/Desktop/Development/roadze-base/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:drop => db:load_config => environment
(See full trace by running task with --trace)
taurenltd#Shawns-MBP roadze-base % rails db:drop db:create db:migrate
/Users/taurenltd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/Users/taurenltd/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here
rails aborted!
NameError: undefined local variable or method `request' for main:Object
Did you mean? require
/Users/taurenltd/Desktop/Development/roadze-base/config/initializers/devise.rb:55:in `block in <main>'
/Users/taurenltd/Desktop/Development/roadze-base/config/initializers/devise.rb:5:in `<main>'
/Users/taurenltd/Desktop/Development/roadze-base/config/environment.rb:5:in `<main>'
/Users/taurenltd/Desktop/Development/roadze-base/bin/rails:9:in `<top (required)>'
/Users/taurenltd/Desktop/Development/roadze-base/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Got this working by using the following block
def self.matches?(request)
if request.subdomain.present? && request.subdomain == 'app'
config.case_insensitive_keys = [:username]
elsif request.subdomain.present && request.subdomain == 'support'
config.case_insensitive_keys = [:email]
end
end
I got a database to seed to test my code. When I run rake db:seed to seed the database, I get the error below.
I expected the console to be blank: this means the data has been seeded.
Error:
[19:19:41] (master) simple-partials-lab-noukod-000
// ♥ rake db:seed
/usr/local/rvm/gems/ruby-2.6.1/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
rake aborted!
ArgumentError: missing keywords: from, to
/usr/local/rvm/gems/ruby-2.6.1/gems/faker-2.2.1/lib/faker/default/date.rb:6:in `between'
/home/considerate-transform-1229/simple-partials-lab-noukod-000/db/seeds.rb:9:in `block in <top (required)>'
/home/considerate-transform-1229/simple-partials-lab-noukod-000/db/seeds.rb:8:in `times'
/home/considerate-transform-1229/simple-partials-lab-noukod-000/db/seeds.rb:8:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.1/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in `load'
/usr/local/rvm/gems/ruby-2.6.1/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in `block in load'
/usr/local/rvm/gems/ruby-2.6.1/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.6.1/gems/activesupport-4.2.11.1/lib/active_support/dependencies.rb:268:in `load'
/usr/local/rvm/gems/ruby-2.6.1/gems/railties-4.2.11.1/lib/rails/engine.rb:547:in `load_seed'
/usr/local/rvm/gems/ruby-2.6.1/gems/activerecord-4.2.11.1/lib/active_record/tasks/database_tasks.rb:253:in `load_seed'
/usr/local/rvm/gems/ruby-2.6.1/gems/activerecord-4.2.11.1/lib/active_record/railties/databases.rake:173:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-2.6.1/gems/rake-12.3.3/exe/rake:27:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in `<main>'
Tasks: TOP => db:seed
(See full trace by running task with --trace)
Looks like you're using Faker with the old syntax. It recently changed to require keyword arguments rather than positional arguments.
You need to follow the updated syntax:
Faker::Date.between(from: 2.days.ago, to: Date.today) #=> "Wed, 24 Sep 2014"
Note the keywords from: and to: which specify the arguments. Order of arguments is not important, and the reverse order will work just the same:
Faker::Date.between(to: Date.today, from: 2.days.ago) #=> "Wed, 24 Sep 2014"
Additional information available in their docs: https://github.com/faker-ruby/faker/blob/master/doc/default/date.md
i have a rake task as follows-
desc 'send fetch request'
task send_fetch_request: :environment do
FacebookCrawl.new.process
end
Yesterday this task working, but I don't know why it is not working today.
I am trying to execute this with the below command-
rake send_fetch_request
Class details:
class FacebookCrawl
def initialize
fb_config = YAML.load_file(Rails.root.join("config/facebook_catalog.yml"))
#access_token = fb_config["facebook"]["access_token"]
#product_feed_ids = fb_config["facebook"]["product_feed_ids"]
end
def process
#product_feed_ids.each do |key,value|
feed_id = value["id"]
feed_url = value["feed_url"]
make_request(feed_id,feed_url,#access_token)
end
end
end
I am getting below error:
rake send_fetch_request --trace
** Invoke send_fetch_request (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute send_fetch_request
rake aborted!
NameError: undefined local variable or method ` FacebookCrawl' for main:Object
/Users/raj.sharma/Documents/Developer/Feed/lib/tasks/facebook_fetch_request_task.rake:3:in `block in <top (required)>'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `call'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/Users/raj.sharma/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/Users/raj.sharma/.rbenv/versions/2.2.2/bin/rake:22:in `load'
/Users/raj.sharma/.rbenv/versions/2.2.2/bin/rake:22:in `<main>'
Tasks: TOP => send_fetch_request
Yesterday it was working fine, I don't why rake is complaining today. Please help.
Please, look carefully at the error message:
NameError: undefined local variable or method ` FacebookCrawl' for main:Object
# ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ ↑↑↑
The first giveaway is that you get a NameError for an undefined local variable or method, and not for a constant. The second giveaway is the name that Ruby complains about: it doesn't complain about FacebookCrawl, it complains about FacebookCrawl.
In Ruby, only the Unicode characters U+0020 SPACE and U+0009 CHARACTER TABULATION are treated as whitespace. You have two Chinese U+3000 IDEOGRAPHIC SPACE characters, which Ruby simply treats as part of the name, and since they are not uppercase characters, it treats the name as a local variable or message send.
You should probably turn on visible whitespace in your editor, e.g. this is how your code looks in my editor, making it immediately obvious where the problem is:
Copy the facebook_crawl.rb in app/services folder & restart the server.
This is your business logic, so it should be in services folder & not in the models
So create a services folder as well in the app directory.
I have a rails app on my server which runs perfectly when I do rails s -b domain.name but when I run rails s -b domain.name -e production or RAILS_ENV=production rails s -b domain.name I have this following error.
=> Booting Puma
=> Rails 4.2.6 application starting in production on http://domain.name:3000
=> Run 'rails server -h' for more startup options
=> Ctrl-C to shutdown server
Exiting
/home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:244:in 'rescue in load_dependency': /home/deploy/appname/app/controllers/users/confirmations_controller.rb:2: unknown regexp options - cfrat (SyntaxError)
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:7: unknown regexp options - cfrat
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:12: unknown regexp options - cfrat
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:13: syntax error, unexpected keyword_def, expecting ':'
def show
^
/home/deploy/appname/app/controllers/users/confirmations_controller.rb:27: syntax error, unexpected keyword_end, expecting end-of-input
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:237:in 'load_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:360:in 'require_or_load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:317:in 'depend_on'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:233:in 'require_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:472:in 'block (2 levels) in eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:471:in 'block in eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:469:in 'eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:346:in 'eager_load!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application/finisher.rb:56:in 'block in <module:Finisher>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 'instance_exec'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in 'run'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in 'block in run_initializers'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:228:in 'block in tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:350:in 'block (2 levels) in each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:431:in 'each_strongly_connected_component_from'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:349:in 'block in each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:347:in 'each_strongly_connected_component'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:226:in 'tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/tsort.rb:205:in 'tsort_each'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in 'run_initializers'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application.rb:352:in 'initialize!'
from /home/deploy/appname/config/environment.rb:5:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'block in require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:240:in 'load_dependency'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/activesupport-4.2.6/lib/active_support/dependencies.rb:274:in 'require'
from /home/deploy/appname/config.ru:3:in 'block in <main>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 'instance_eval'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in 'initialize'
from /home/deploy/appname/config.ru:in 'new'
from /home/deploy/appname/config.ru:in '<main>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 'eval'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in 'new_from_string'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in 'parse_file'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:299:in 'build_app_and_options_from_config'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:208:in 'app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:61:in 'app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:336:in 'wrapped_app'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.6.4/lib/rack/server.rb:272:in 'start'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in 'start'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in 'block in server'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'tap'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in 'server'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in 'run_command!'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in '<top (required)>'
from /home/deploy/appname/bin/rails:9:in 'require'
from /home/deploy/appname/bin/rails:9:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in 'load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client/command.rb:7:in 'call'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/client.rb:30:in 'run'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/bin/spring:49:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in 'load'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in '<top (required)>'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /home/deploy/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
from /home/deploy/appname/bin/spring:13:in '<top (required)>'
from bin/rails:3:in 'load'
from bin/rails:3:in '<main>'
Edit
And this is the file causing the error :
/home/deploy/appname/app/controllers/users/confirmations_controller.rb
class Users::ConfirmationsController < Devise::ConfirmationsController
GET /resource/confirmation/new
def new
super
end
POST /resource/confirmation
def create
super
end
GET /resource/confirmation?confirmation_token=abcdef
def show
super
end
protected
The path used after resending confirmation instructions.
def after_resending_confirmation_instructions_path_for(resource_name)
super(resource_name)
end
The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
super(resource_name, resource)
end
end
The error seems to come from Devise auto generated files but I cannot figure out why it happens only in prodcution mode.
I think you tried to override the devise default behaviour using rails generate devise:controllers and you may have changed them badly.
Please be sure that:
You need to override the default controllers, unless you can remove controllers/users folder (If the name of your model you applied Devise on is Users)
Check syntax in all the files in controller/users.
I have a rails model that keeps track of other models in an app. (unusual, but necessary for this project).
When I try to assign the attribute model_name I get an error that occurs once, but then doesn't occur again.
AppModel
model_name created_at updated_at
----------------------------------------
User
Question
Post
Answer
In console, I'm getting a strange error:
> model = AppModel.new
> model.model_name = "User" # First time causes the error.
> model.model_name = "User" # Second time it works.
Error:
ActiveRecord::DangerousAttributeError: record_changed? is defined by Active Record
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.4/lib/active_record/attribute_methods.rb:104:in `instance_method_already_implemented?'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:288:in `block in define_attribute_method'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:285:in `each'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:285:in `define_attribute_method'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:252:in `block in define_attribute_methods'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:252:in `each'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activemodel-4.1.4/lib/active_model/attribute_methods.rb:252:in `define_attribute_methods'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.4/lib/active_record/attribute_methods.rb:75:in `block in define_attribute_methods'
from /Users/donaldpinkus/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mutex_m.rb:73:in `synchronize'
from /Users/donaldpinkus/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/mutex_m.rb:73:in `mu_synchronize'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.4/lib/active_record/attribute_methods.rb:72:in `define_attribute_methods'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.4/lib/active_record/attribute_methods.rb:196:in `method_missing'
from (irb):3
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:90:in `start'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/console.rb:9:in `start'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:69:in `console'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in `require'
from /Users/donaldpinkus/Projects/hooker/bin/rails:8:in `<top (required)>'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/donaldpinkus/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:in `load'
from /Users/donaldpinkus/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/donaldpinkus/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'2.1.5 :004 > e.model_name = "User"
=> "User"
"model_name" isn't a reserved word for models, so what is happening here?
This happens because there is already a method in ActiveRecord models, which is called exactly model_name, that returns (obviously) the name of this model (among other things).
From:
.../ruby-2.1.5/gems/activemodel-4.2.0/lib/active_model/naming.rb
# line 222:
Owner: ActiveModel::Naming
Visibility: public
Signature: model_name()
Number of lines: 12
Returns an ActiveModel::Name object for module. It can be used to
retrieve all kinds of naming-related information (See
ActiveModel::Name for more information).
When ActiveRecord fetches an object from the table, it also creates methods with names corresponding to the column names in the table. What happens is it fetches an object, sees a column model_name on the given object, tries to define a method model_name and suddenly finds out that it already exists.
Here's a thing: avoid needlessly long attribute names. If you're defining a name in a model, it can just be name, it's scoped to "model" class anyway, obviously it's the model's name.
The error reporting code, however, likely contains a bug that needs to be tracked down.