Getting this error after running `bin/rake` in my terminal - ruby-on-rails

I am getting the error message below after running bin/rake in my terminal.
Does anyone know what's going on and how to fix it?
My terminal error output is as follows:
treehouse:~/projects/odot (master *) $ bin/rake
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -I/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib:/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-support-3.0.4/lib -S /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/exe/rspec ./spec/controllers/todo_items_controller_spec.rb ./spec/controllers/todo_lists_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/features/todo_items/complete_spec.rb ./spec/features/todo_items/create_spec.rb ./spec/features/todo_items/delete_spec.rb ./spec/features/todo_items/edit_spec.rb ./spec/features/todo_items/index_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_items_helper_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/helpers/users_helper_spec.rb ./spec/models/todo_item_spec.rb ./spec/models/todo_list_spec.rb ./spec/models/user_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/routing/users_routing_spec.rb ./spec/views/todo_items/index.html.erb_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb ./spec/views/users/edit.html.erb_spec.rb ./spec/views/users/new.html.erb_spec.rb ./spec/views/users/show.html.erb_spec.rb
/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require': cannot load such file -- rails_helper (LoadError)
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `block in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:229:in `require'
from /home/treehouse/projects/odot/spec/controllers/users_controller_spec.rb:1:in `<top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `block in load'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:97:in `setup'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/exe/rspec:4:in `<main>'
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -I/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/lib:/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-support-3.0.4/lib -S /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-3.0.4/exe/rspec ./spec/controllers/todo_items_controller_spec.rb ./spec/controllers/todo_lists_controller_spec.rb ./spec/controllers/users_controller_spec.rb ./spec/features/todo_items/complete_spec.rb ./spec/features/todo_items/create_spec.rb ./spec/features/todo_items/delete_spec.rb ./spec/features/todo_items/edit_spec.rb ./spec/features/todo_items/index_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_items_helper_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/helpers/users_helper_spec.rb ./spec/models/todo_item_spec.rb ./spec/models/todo_list_spec.rb ./spec/models/user_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/routing/users_routing_spec.rb ./spec/views/todo_items/index.html.erb_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb ./spec/views/users/edit.html.erb_spec.rb ./spec/views/users/new.html.erb_spec.rb ./spec/views/users/show.html.erb_spec.rb failed
treehouse:~/projects/odot (master *) $

It says /home/treehouse/projects/odot/spec/controllers/users_controller_spec.rb is failing to load rails_helper.rb.

Related

Rails, using rspec to run one file

I want to run an rspec test on one file.
I have tried various methods such as
rspec path/to/spec/file.rb
rake spec SPEC=spec/controllers/sessions_controller_spec.rb
bundle exec rspec path/to/spec/file.rb
But all of them give me this error:
.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:146:in `to_app': missing run or map statement (RuntimeError)
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:160:in `block in generate_map'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:160:in `each'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:160:in `generate_map'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rack-2.0.3/lib/rack/builder.rb:145:in `to_app'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/capybara-2.16.1/lib/capybara/rails.rb:13:in `<top (required)>'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
from /home/jay/Sites/New Folder/pg/scheduler/spec/spec_helper.rb:19:in `<top (required)>'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `require'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `block in requires='
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `each'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `requires='
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `each'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:21:in `configure'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:99:in `setup'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:86:in `run'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:71:in `run'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:45:in `invoke'
from /home/jay/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rspec-core-3.7.0/exe/rspec:4:in `<main>'
How do I run an rspec test on one file?
I tried :
ruby -I test test/unit/my_model_test.rb
and it worked for me let me know if it helped you

rails; shoulda-matchers suddenly give uninitialized constant error

As you see between the first and second savings in the spec file ~15s passed. After the first saving I got the error because of the typo, then suddenly after the second saving I started getting the uninitialized constant: Shoulda (NameError).
Since then I've been getting this error after every save. Before this issue everything worked fine.
Why is this happening?
16:15:03 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91917
/Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load': /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:8: syntax error, unexpected '{', expecting ')' (SyntaxError)
let(:executed_task { create(:task, executor: user) }
^
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:8: syntax error, unexpected '}', expecting keyword_end
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `block in load'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:268:in `load'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
16:15:04 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2 spec/controllers/tasks_controller_spec.rb" (exit code: 1)
16:15:17 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91930
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:1:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
16:15:20 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2 spec/controllers/tasks_controller_spec.rb" (exit code: 1)
16:15:43 - INFO - Running: spec/controllers/tasks_controller_spec.rb
Running via Spring preloader in process 91941
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/controllers/tasks_controller_spec.rb:1:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
16:15:45 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2 spec/controllers/tasks_controller_spec.rb" (exit code: 1)
16:16:39 - INFO - Running: spec/models/conversation_spec.rb
Running via Spring preloader in process 91963
/Users/Silo/Desktop/ruby_on_rails/faskyn/spec/rails_helper.rb:16:in `<top (required)>': uninitialized constant Shoulda (NameError)
from /Users/Silo/Desktop/ruby_on_rails/faskyn/spec/models/conversation_spec.rb:1:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
from /Users/Silo/.rvm/gems/ruby-2.2.3/gems/spring-commands-rspec-1.0.4/lib/spring/commands/rspec.rb:18:in `call'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/Silo/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
16:16:41 - ERROR - Failed: "spring rspec -f progress -r /Users/Silo/.rvm/gems/ruby-2.2.3/gems/guard-rspec-4.6.4/lib/guard/rspec_formatter.rb -f Guard::RSpecFormatter --failure-exit-code 2 spec/models/conversation_spec.rb" (exit code: 1)

`require': cannot load such file -- debugger (LoadError) - Ruby

/home/si/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- debugger (LoadError)
from /home/si/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in `load'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1327:in `block in load_spec_files'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in `each'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb:1325:in `load_spec_files'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:102:in `setup'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:88:in `run'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:73:in `run'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb:41:in `invoke'
from /home/si/.rvm/gems/ruby-2.2.1/gems/rspec-core-3.3.2/exe/rspec:4:in `<top (required)>'
from /home/si/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `load'
from /home/si/.rvm/gems/ruby-2.2.1/bin/rspec:23:in `<main>'
from /home/si/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
from /home/si/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
I type rspec from the folder where lib and spec are present to get this error. I tried searching other links to no avail. Basically, I need to run autotest but it shows the "require could not load file" error.
What is the solution?
Thanks a lot in advance.

Rails Test Failing

I keep getting these errors on terminal whenever i run the following code.
rake test or bundle exec rake test
/usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': cannot load such file -- guard (LoadError)
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/guard-minitest-2.4.4/lib/minitest/guard_minitest_plugin.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:91:in `block in load_plugins'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:85:in `load_plugins'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:114:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/minitest-5.5.1/lib/minitest.rb:56:in `block in autorun'
Looks like guard is not installed/included in Gemfile. Include it in Gemfile if it is not already there. And run bundle install.
See http://railscasts.com/episodes/264-guard for how to use guard. https://github.com/guard/guard is also a good resource.

Loaderror: cannot find such file

Hi i have just started making an app on ruby on rails and i have problems writing my spec files.
i ran bundle exec rspec spec/controllers/api/user_controller_spec.rb but it gave me the error:
/home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load': cannot load such file -- /home/action
/slidey/spec/controllers/api/user_controller_spec.rb (LoadError)
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `block in load_spec_files'
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `each'
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/configuration.rb:819:in `load_spec_files'
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/command_line.rb:22:in `run'
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:80:in `run'
from /home/action/.gem/ruby/2.0.0/gems/rspec-core-2.13.1/lib/rspec/core/runner.rb:17:in `block in autorun'
EDIT: when i ran bundle exec rspec spec they gave me the following error:
/home/action/.gem/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `has
_attached_file' for #<Class:0x007f44f503bee8> (NoMethodError)
from /home/action/slidey/app/models/documents.rb:6:in `<class:Documents>'
from /home/action/slidey/app/models/documents.rb:1:in `<top (required)>'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:330:in `require_or_load'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:463:in `load_missing_constant'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:184:in `const_missing'
from /home/action/slidey/spec/models/documents_spec.rb:3:in `<top (required)>'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `block in load'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/action/.gem/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:223:in `load'
can anyone shed some light on this? what does it mean?
It looks like it cannot find the file spec/controllers/api/user_controller_spec.rb
Try to rename your spec file into users_controller_spec.rb

Resources