7stud --
2011-Sep-02 18:58 UTC
rspec error: `inherited'': You cannot have more than one Rails::Application (RuntimeError)
Some background: I set up my first rails app for testing with rspec, and everything worked fine: I could run tests, etc. Then I created a second rails app to play around with (and a third, fourth). But I can''t get testing to work with my second rails app. When I cd''ed to my second app''s directory and did this: $ bundle exec rspec spec/ it ran the tests for my first app. My first app has about 150 tests, and my second app has 3 tests, so it was obviously not running the correct tests. In an attempt to cure that problem, I did took these steps: 1) I closed out all windows on my computer. 2) I restarted my computer. 3) I opened a terminal window and cd''ed into my second apps directory, and then I did this: $ bundle exec rpsec spec/ and I got this error: No DRb server is running. Running in local process instead ... /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/application.rb:63:in `inherited'': You cannot have more than one Rails::Application (RuntimeError) from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/deprecation.rb:7:in `initialize'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/deprecation.rb:7:in `new'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/deprecation.rb:7:in `run'' from /Users/me/rails_projects/test_app/app/models/generate/config/environment.rb:9:in `<top (required)>'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:454:in `load'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:454:in `block in load_file'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:596:in `new_constants_in'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:453:in `load_file'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:340:in `require_or_load'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:300:in `depend_on'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.0.9/lib/active_support/dependencies.rb:216:in `require_dependency'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/engine.rb:138:in `block (2 levels) in eager_load!'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/engine.rb:137:in `each'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/engine.rb:137:in `block in eager_load!'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/engine.rb:135:in `each'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/engine.rb:135:in `eager_load!'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/application.rb:108:in `eager_load!'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/application/finisher.rb:41:in `block in <module:Finisher>'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `instance_exec'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `block in run_initializers'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `each'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'' from /Users/me/rails_projects/test_app/config/environment.rb:5:in `<top (required)>'' from /Users/me/rails_projects/test_app/spec/spec_helper.rb:14:in `require'' from /Users/me/rails_projects/test_app/spec/spec_helper.rb:14:in `block in <top (required)>'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/spork-0.9.0.rc8/lib/spork.rb:24:in `prefork'' from /Users/me/rails_projects/test_app/spec/spec_helper.rb:4:in `<top (required)>'' from /Users/me/rails_projects/test_app/spec/controllers/pages_controller_spec.rb:1:in `require'' from /Users/me/rails_projects/test_app/spec/controllers/pages_controller_spec.rb:1:in `<top (required)>'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `block in load_spec_files'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:66:in `rescue in run'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:62:in `run'' from /Users/me/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'' === My Gemfiles are exactly the same for each app. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
7stud --
2011-Sep-02 23:55 UTC
Re: rspec error: `inherited'': You cannot have more than one Rails::Application (RuntimeError)
cross posted here: http://stackoverflow.com/questions/7290186/rspec-runs-the-tests-in-another-app -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jim Ruther Nill
2011-Sep-03 02:28 UTC
Re: Re: rspec error: `inherited'': You cannot have more than one Rails::Application (RuntimeError)
On Sat, Sep 3, 2011 at 7:55 AM, 7stud -- <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> cross posted here: > > > http://stackoverflow.com/questions/7290186/rspec-runs-the-tests-in-another-app > >Haven''t encountered that error before. But googling the error message gives quite a few useful results (i think) :D> -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
7stud --
2011-Sep-03 03:15 UTC
Re: Re: rspec error: `inherited'': You cannot have more than one Rails::Application (RuntimeError)
Jim ruther Nill wrote in post #1019886:> On Sat, Sep 3, 2011 at 7:55 AM, 7stud -- <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> cross posted here: >> >> >> http://stackoverflow.com/questions/7290186/rspec-runs-the-tests-in-another-app >> >> > Haven''t encountered that error before. But googling the error message > gives > quite a few useful results (i think) :D >Nope. Google returns no information about the error. I have come to the conclusion that my problem has to do with the name of my app--it''s test_app. I created another app and after running through the extensive setup, I can now run rspec tests on it. For my test_app, I tried deleting the gemset and reinstalling rails and all the gems, but I could never get the tests to work. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.