I am working my way through the Ruby on Rails Tutorial. In chapter 5, I've hit another bump in the road that I can't figure out nor find a solution for.
For one, my home page has dissapeared and I don't know why. That is, for some reason the access to it is gone.
And when I run the test. I get the following response:
Exception encountered: RuntimeError: Application has been already initialized.
backtrace:
Can someone help?
Here is the backtrace (with some helpful formatting for easier viewing):
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:135:in `initialize!'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/tomgalpin/rails_projects/sample_app/config/environment.rb:5:in `<top (required)>'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
/Users/tomgalpin/rails_projects/sample_app/spec/spec_helper.rb:3:in `<top (required)>'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:11:in `block in run'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:21:in `block in initialize'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:18:in `fork'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/forker.rb:18:in `initialize'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `new'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/run_strategy/forking.rb:9:in `run'
/Users/tomgalpin/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/spork-0.9.2/lib/spork/server.rb:48:in `run'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/Users/tomgalpin/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
This fixed the issue for me:
bundle exec spork --bootstrap
Related
I am trying to build a skeleton rails-api to use for future use but keep coming across an error. So i am in a folder call Rails_API_Skeleton and i run..
gem install rails-api
Which runs fine.
I then run...
rails-api new Skeleton_App -d postgresql -T
Which also runs without any issues. So i...
cd Skeleton_App/
then run...
bin/rake db:create
And get the following error, which after much googling i cant figure out how to resolve.
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:89:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'rails-api'.
Gem Load Error is: uninitialized constant ActionController::API::RackDelegation
Backtrace for gem load error is:
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:131:in `<class:API>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:85:in `<module:ActionController>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api/action_controller/api.rb:5:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/rails-api-0.4.0/lib/rails-api.rb:3:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
/Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
/Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
(Bundler::GemRequireError)
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:85:in `block (2 levels) in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /Users/username/Desktop/Apple_tv_movies_and_stuff/skeletons/Rails_API_Skeleton/Skeleton_App/config/application.rb:17:in `<top (required)>'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `require'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:82:in `preload'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:143:in `serve'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:131:in `block in run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `loop'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application.rb:125:in `run'
from /Users/username/.rvm/gems/ruby-2.2.2/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/username/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Thanks for any help in advance
I suspect something changed with the gem in response to Rails 5.
Maybe its use is deprecated now?
Anyway, the new Rails API way seems to be
http://edgeguides.rubyonrails.org/api_app.html
rails new skeleton_api --api
I have an up to date rails application, using rails 3.2 with mongoid 2. I was unable to start testing by typing rake. The exception thrown is (sanitized):
rake test
/railsapp/app/models/image.rb:18:in `<class:Image>': undefined method `[]' for nil:NilClass (NoMethodError)
from /railsapp/app/models/image.rb:1:in `<top (required)>'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:359:in `require_or_load'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:313:in `depend_on'
from /gems/activesupport-3.2.8/lib/active_support/dependencies.rb:225:in `require_dependency'
from /gems/railties-3.2.8/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
from /gems/railties-3.2.8/lib/rails/engine.rb:438:in `each'
from /gems/railties-3.2.8/lib/rails/engine.rb:438:in `block in eager_load!'
from /gems/railties-3.2.8/lib/rails/engine.rb:436:in `each'
from /gems/railties-3.2.8/lib/rails/engine.rb:436:in `eager_load!'
from /gems/railties-3.2.8/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>'
from /gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from /gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from /gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from /gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from /gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from /gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /railsapp/config/environment.rb:7:in `<top (required)>'
from /railsapp/test/test_helper.rb:2:in `require'
from /railsapp/test/test_helper.rb:2:in `<top (required)>'
from /railsapp/test/unit/post_test.rb:1:in `require'
from /railsapp/test/unit/post_test.rb:1:in `<top (required)>'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `require'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `each'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `select'
from /gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
Errors running test:units! #<RuntimeError: Command failed with status (1): [/Users/janlimpens/.rvm/rubies/ruby-1.9.3-p...]>
I created a gist with the files that are of interest in the context:
https://gist.github.com/3989760
There is no test concerning the image model at all, there are no fixtures and the only test I have got is included into the gist, but it is not to blame, the error is thrown upon including test_helper.rb.
What are my options?
When the tests start Rails loads up, as it does so it evaluates all of your models.
This includes the Image model, which apparently has a bug or typo on line 18.
Which would be this line:
:path => "#{APP_CONFIG['uploads_dir']}/:class/:id/:attachment/:style.:extension",
The only array notation here is:
APP_CONFIG['uploads_dir']
So, where is APP_CONFIG defined? And why is it a nil? These are the questions we must answer.
You might start by grepping your project for this string.
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
Pretty much there in the title. I worked on a project with someone else, then cloned the git repo to my computer, added a new controller, and then thought better so ran:
rails destroy controller requests
(requests is the name of the controller), only to get this endless error message:
/Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:181:in `default_controller_and_action': missing :controller (ArgumentError)
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `new'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `each'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:1270:in `match'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:507:in `map_method'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/mapper.rb:469:in `get'
from /Users/sashafklein/rails_projects/meatup/config/routes.rb:3:in `block in <top (required)>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/actionpack-3.2.8/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /Users/sashafklein/rails_projects/meatup/config/routes.rb:1:in `<top (required)>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:245:in `load'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/activesupport-3.2.8/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/sashafklein/rails_projects/meatup/config/environment.rb:5:in `<top (required)>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:103:in `require'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/gems/railties-3.2.8/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
It's worked before, so what's happening? Might I need to reinstall something that got overwritten?
Also, any ideas why on earth is the error pasting all that stuff about the rails tutorial I'm taking? I don't remember that text being anywhere in my files?
Thanks
It seems like you might have an error with your routes. Did any new routes get added to your routes.rb? If so, try commenting them out and then running your command.
I tried to comment out the gem files and whenever I use rake, I get the following error:
(in /home/egervari/Projects/training)
rake aborted!
undefined method `basename' for "/usr/local/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.7":String
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:601:in `block in latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb:62:in `block (2 levels) in deprecate'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:112:in `other_spork_gem_load_paths'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:105:in `detect_and_require'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork/test_framework.rb:167:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey/spork/test_framework/rspec.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/core.rb:65:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec/rails/tasks/rspec.rake:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `all'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/egervari/Projects/training/Rakefile:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `<main>'
In addition to the above problem... besides doing a text-search for all the places in my rails app that uses cucumber, is there any special gotchas?
It would appear that I have fixed the problem on my own (and it would have been infinitely hard for anyone to fix blindly me thinks).
For some reason, removing Cucumber caused Spork to cause this error. I do not understand why, but Spork used to work fine... and now it doesn't :/
The solution was to remove spork.
I think there is a bug in either Spork, or somewhere down the line. It has something to do with the paths. Someone else noticed that the code is calling basename on a string, but it should have used File.basename(the_string) instead.
I would imagine that this got fixed in newer versions, but it probably won't be patched for those of us using Rails 3.0.7
Anyhoo, if you're getting this problem, just remove Spork. I know it sucks, but Spork kind of over-promises and under-delivers anyway - at least for me :( In my experience of using it this week, it has caused more headaches and problems than the time it has saved me. So, it's time for Spork to go.
Anyway, I hope that helps others.