I'm new to rails and can't pinpoint the issue. I was following the RailsCast tutorial #209 about Devise and get an error when I run: rails g devise:views
Here is the error:
/Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:185:in `default_controller_and_action': missing :action (ArgumentError)
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:78:in `normalize_options!'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:61:in `initialize'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1304:in `new'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1304:in `add_route'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1284:in `decomposed_match'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `block in match'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `each'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1270:in `match'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:260:in `root'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/mapper.rb:1317:in `root'
from /Users/chanel.nalani/svn-work/gwb/trunk/PMOCCU/uidevise/config/routes.rb:8:in `block in <top (required)>'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:282:in `instance_exec'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:282:in `eval_block'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:260:in `draw'
from /Users/chanel.nalani/svn-work/gwb/trunk/PMOCCU/uidevise/config/routes.rb:1:in `<top (required)>'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:245:in `load'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `each'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/file_update_checker.rb:78:in `call'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/file_update_checker.rb:78:in `execute'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:27:in `updater'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application/finisher.rb:66:in `block in <module:Finisher>'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/initializable.rb:30:in `run'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `each'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application.rb:136:in `initialize!'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/chanel.nalani/svn-work/gwb/trunk/PMOCCU/uidevise/config/environment.rb:5:in `<top (required)>'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.5/lib/active_support/dependencies.rb:251:in `require'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/application.rb:103:in `require_environment!'
from /Users/chanel.nalani/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.5/lib/rails/commands.rb:25:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I changed the version of ruby to see if that would fix the issue but I haven't been able to find the exact problem. Did anybody else run into this error?
Looks like you are missing some manual setup that needs to be done(as #dougui and #janders223 pointed out, it's most likely your route), as printed on the console as soon as you finished running rails generate devise:install :
===============================================================================
Some setup you must do manually if you haven't yet:
1. Ensure you have defined default url options in your environments files. Here
is an example of default_url_options appropriate for a development environment
in config/environments/development.rb:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
In production, :host should be set to the actual host of your application.
2. Ensure you have defined root_url to *something* in your config/routes.rb.
For example:
root :to => "home#index"
3. Ensure you have flash messages in app/views/layouts/application.html.erb.
For example:
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
4. If you are deploying Rails 3.1 on Heroku, you may want to set:
config.assets.initialize_on_precompile = false
On config/application.rb forcing your application to not access the DB
or load models when precompiling your assets.
===============================================================================
Taken from https://github.com/plataformatec/devise/blob/master/lib/generators/templates/README
Related
I'm trying to setup a barebones Rails app. So far I have generated a sample Article model, added some records to the database, edited my routes config to the following:
Rails::Application.routes.draw do
resources :articles
end
But when I run bin/rake routes, bundle exec rake routes, and just rake routes I receive the following error:
$ bin/rake routes (articles-controllerā±)
rake aborted!
Rails::Application is abstract, you cannot instantiate it directly.
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/railtie.rb:206:in `initialize'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/engine.rb:434:in `initialize'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:124:in `initialize'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/railtie.rb:162:in `new'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/railtie.rb:162:in `instance'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:95:in `instance'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/railtie.rb:184:in `method_missing'
/Users/sam/turing/2module/personal_work/projects/blogger/config/routes.rb:1:in `<top (required)>'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:286:in `load'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:286:in `block in load'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:286:in `load'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:55:in `each'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:55:in `load_paths'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:18:in `reload!'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:41:in `block in updater'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/file_update_checker.rb:81:in `call'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/activesupport-5.1.1/lib/active_support/file_update_checker.rb:81:in `execute'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:42:in `updater'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `instance_exec'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/initializable.rb:30:in `run'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/initializable.rb:59:in `block in run_initializers'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/initializable.rb:58:in `run_initializers'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:353:in `initialize!'
/Users/sam/turing/2module/personal_work/projects/blogger/config/environment.rb:5:in `<top (required)>'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:329:in `require'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:329:in `require_environment!'
/Users/sam/.rvm/gems/ruby-2.2.6/gems/railties-5.1.1/lib/rails/application.rb:445:in `block in run_tasks_blocks'
Tasks: TOP => routes => environment
(See full trace by running task with --trace)
Any ideas? All of my gems are up to date using bundle update
Oops, looks like the syntax for the routes.rb file is a bit different in Rails 5. For anyone else with this issue, the syntax for the do block is Rails.application.routes.draw do, not Rails::Application.routes.draw do
Hey I am new to rails and I am getting this error whenever I try to run
rails generate devise User
I get this error in there terminal:
/usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0x007fcad64c5e20 #paths=["/Users/DavidStevenson/Desktop/omrails/omrails/config/routes.rb"], #route_sets=[#<ActionDispatch::Routing::RouteSet:0x007fcad64c5d80>]> (RuntimeError)
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/application.rb:215:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/DavidStevenson/Desktop/omrails/omrails/config/environment.rb:5:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:213:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activesupport-4.0.0.rc2/lib/active_support/dependencies.rb:228:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/application.rb:189:in `require_environment!'
from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/railties-4.0.0.rc2/lib/rails/commands.rb:47:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have looked in the routes.rb file and could not see anything apparently wrong. When I comment out the line:
devise_for :installs
I can run the server again. Any thoughts why this would happen?
Firstly, why do you use ruby 1.9.3 instead of 2.0 ?
Secondly, why do you use rails 4.0.0.rc2 instead of its stable release 4.0 ?
For your question,
devise requires devise_for :users in your routes.rb file. It must be same as your resource name. Use user both in routes.rb and at your generator.
I found this error after migrating from Active Record to MongoID, the problem is that the Devise initializer (config/initializers/devise.rb) specifies the ORM (line 25 for me):
require 'devise/orm/active_record'
I just only needed to replace this line with:
require 'devise/orm/mongoid'
Now is working :)
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.
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.
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".