Off course I read this:
rspec testing throws Uninitialized constant Rails (NameError)
But I am sure that there is nothing wrong with my code.
Just because of the operation system! (Thread?)
Here is the error message when ran rspec:
/home/user/testapp/spec/spec_helper.rb:26:in `block in <top (required)>': uninitialized constant Rails (NameError)
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core.rb:98:in `configure'
from /home/user/testapp/spec/spec_helper.rb:22:in `<top (required)>'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1394:in `block in requires='
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1394:in `each'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:1394:in `requires='
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:111:in `each'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:21:in `configure'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:99:in `setup'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86:in `run'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:71:in `run'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:45:in `invoke'
from /home/user/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rspec-core-3.5.4/exe/rspec:4:in `<top (required)>'
from /home/user/.rbenv/versions/2.3.1/bin/rspec:23:in `load'
from /home/user/.rbenv/versions/2.3.1/bin/rspec:23:in `<main>'
The L26 of the spec_helper file is:
Rails.application.env_config['action_dispatch.show_detailed_exceptions'] = false
Related
I've playing with cucumber and just noticed that my Rspec tests began failing. Everything was running well before I installed cucumber. Any ideas?
LOG
/Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.5/lib/action_controller/base.rb:164:in `<module:ActionController>': uninitialized constant ActionController::Metal (NameError)
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/actionpack-4.1.5/lib/action_controller/base.rb:5:in `<top (required)>'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/responders-1.1.1/lib/responders.rb:1:in `<top (required)>'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/devise-3.4.0/lib/devise.rb:7:in `<top (required)>'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from /Users/szymonborucki/code/rails/Challenger/spec/spec_helper.rb:18:in `<top (required)>'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration.rb:1072:in `block in requires='
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration.rb:1072:in `each'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration.rb:1072:in `requires='
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration_options.rb:103:in `block in process_options_into'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration_options.rb:102:in `each'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration_options.rb:102:in `process_options_into'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/configuration_options.rb:22:in `configure'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/runner.rb:95:in `setup'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/runner.rb:84:in `run'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/runner.rb:69:in `run'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/lib/rspec/core/runner.rb:37:in `invoke'
from /Users/szymonborucki/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.6/exe/rspec:4:in `<top (required)>'
from /Users/szymonborucki/.rbenv/versions/2.1.0/bin/rspec:23:in `load'
from /Users/szymonborucki/.rbenv/versions/2.1.0/bin/rspec:23:in `<main>'
If I were you, I check that line: /Users/szymonborucki/code/rails/Challenger/spec/spec_helper.rb:18
I hope it helps.
On Rails, I'm trying to rake a new task I just created and it's giving me an undefined method error:
syck has been removed, psych is used instead
rake aborted!
NoMethodError: undefined method `register_middleware' for #<Faraday::Connection:0x007f8773f41288>
/Library/Ruby/Gems/2.0.0/gems/faraday-0.9.0/lib/faraday.rb:99:in `method_missing'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced/client.rb:41:in `build_conn'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced/client.rb:30:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:29:in `new'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:29:in `configure'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:86:in `<module:Balanced>'
/Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:11:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
/Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
/Users/Stephanie/Desktop/Pixiboard/config/application.rb:8:in `<top (required)>'
/Users/Stephanie/Desktop/Pixiboard/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I also get a similar error when trying to run the command "rails console" (to see if there's anything wrong with my task):
syck has been removed, psych is used instead
/Library/Ruby/Gems/2.0.0/gems/faraday-0.9.0/lib/faraday.rb:99:in `method_missing': undefined method `register_middleware' for #<Faraday::Connection:0x007f986c506700> (NoMethodError)
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced/client.rb:41:in `build_conn'
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced/client.rb:30:in `initialize'
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:29:in `new'
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:29:in `configure'
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:86:in `<module:Balanced>'
from /Library/Ruby/Gems/2.0.0/gems/balanced-0.8.1/lib/balanced.rb:11:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/Stephanie/Desktop/Pixiboard/config/application.rb:8:in `<top (required)>'
from /Library/Ruby/Gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:39:in `require'
from /Library/Ruby/Gems/2.0.0/gems/railties-3.2.12/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can anyone help me on what to do?
(I'm on Rails 3.2.12)
balanced-ruby is not yet compatible with faraday 0.9.0. See more balanced-ruby/issues/173
and try to use faraday 0.8.6 in your Gemfile:
gem 'faraday', '~> 0.8.6'
I have create a new Rails engine using the rails plugin new Foobar --full --mountable command. When running bundle console I get uninitialized constant Rails Why is this?
Resolving dependencies...
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:2:in `<module:Foobar>': uninitialized constant Rails (NameError)
from /Users/kyledecot/Desktop/Foobar/lib/foobar/engine.rb:1:in `<top (required)>'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `require'
from /Users/kyledecot/Desktop/Foobar/lib/foobar.rb:1:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:664:in `console'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/command.rb:27:in `run'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor.rb:363:in `dispatch'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/vendor/thor/base.rb:438:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/cli.rb:10:in `start'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `block in <top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/bin/bundle:22:in `<top (required)>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `load'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#global/bin/bundle:23:in `<main>'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `eval'
from /Users/kyledecot/.rvm/gems/ruby-2.0.0-p353#foobar/bin/ruby_executable_hooks:15:in `<main>'
Adding require 'rails' in Foobar/lib/foobar/engine.rb file worked for me. I got my answer from here.
I am getting this error when I run bundle exec cucumber. Is this a rails version error? How can I check if the rails being used has this method defined in the Rails::Application::RoutesReloader class to see if I need to upgrade/downgrade? If not, anyone have any suggestions?
Edit:
Stack Trace:
undefined method `paths' for #<Rails::Application::RoutesReloader:0xac73454> (NoMethodError)
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/engine.rb:517:in `block in <class:Engine>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `block in run_initializers'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails/application.rb:15:in `initialize!'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/ubuntu/hw3_rottenpotatoes/config/environment.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails.rb:7:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-rails-1.3.0/lib/cucumber/rails.rb:7:in `<top (required)>'
/home/ubuntu/hw3_rottenpotatoes/features/support/env.rb:7:in `require'
/home/ubuntu/hw3_rottenpotatoes/features/support/env.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/runtime.rb:40:in `run!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:43:in `execute!'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/lib/cucumber/cli/main.rb:20:in `execute'
/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-1.2.1/bin/cucumber:14:in `<top (required)>'
/usr/local/bin/cucumber:19:in `load'
/usr/local/bin/cucumber:19:in `<main>'
I believe it is an error with rails because when I try to run rails server, it gives me the same error. Something must have happened to the installation because that command ran before without a problem
The name of my app is newsample_app . I am following along the railstutorial screencast for upgrading to rails 3.1. Here is the error message I am getting when copying files over from my old "sample_app" to "newsample_app" and trying to run rspec:
rspec spec/controllers/pages_controller_spec.rb
/Users/topica/rails_projects/newsample_app/config/routes.rb:1:in `': uninitialized constant NewSampleApp (NameError)
After seeing this, I changed my routes.rb file from my original sample_app from "SampleApp::Application.routes.draw do" to this: "NewSampleApp::Application.routes.draw do" but am still getting the error. Any ideas?
FYI complete error:
Topicas-MacBook-Pro:newsample_app topica$ rspec spec/controllers/pages_controller_spec.rb
/Users/topica/rails_projects/newsample_app/config/routes.rb:1:in `<top (required)>': uninitialized constant NewSampleApp (NameError)
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `block in load_paths'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `each'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:29:in `load_paths'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:13:in `reload!'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/routes_reloader.rb:7:in `block in initialize'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/finisher.rb:63:in `block (2 levels) in <module:Finisher>'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `call'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/topica/rails_projects/newsample_app/config/environment.rb:5:in `<top (required)>'
from /Users/topica/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/topica/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/topica/rails_projects/newsample_app/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/topica/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/topica/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/topica/rails_projects/newsample_app/spec/controllers/pages_controller_spec.rb:1:in `<top (required)>'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `block in load_spec_files'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `map'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:419:in `load_spec_files'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/command_line.rb:18:in `run'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:69:in `run'
from /Users/topica/.rvm/gems/ruby-1.9.2-p290#rails3_1tutorial/gems/rspec-core-2.6.4/lib/rspec/core/runner.rb:11:in `block in autorun'
You probably want that to match the same as in config/application.rb
If it really is newsample_app than it is probably NewsampleApp not NewSampleApp
Looks like a case problem.
> "newsample_app".camelize
=> "NewsampleApp"
Note the lowercase "s".