Bit new to rails, but I was generating some controllers, I did one, then went to do another and it spit out an error:
c:\row\dev\a>rails generate controller Person name:string
C:/row/ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/rou
ting/mapper.rb:229:in `default_controller_and_action': missing :controller (Argu
mentError)
I tried rubymine just to see and it pretty much just did the same thing, that full list of what it outputted is below. I've never had it just decide to stop generating controllers like that, and I did add something to the routes file because I saw a link that said the routes file might need root to: 'controller#action' though i've never had to include that in the route file to generate a controller before, but that didn't fix it either. That was the only other thing I could find online with a similar problem. Any thoughts?
C:\row\Ruby200\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:/row/dev/a/bin/rails generate controller person name:string -s
C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `new'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1443:in `add_route'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1422:in `decomposed_match'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1403:in `block in match'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `each'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:1394:in `match'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:601:in `map_method'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/mapper.rb:562:in `get'
from C:/row/dev/a/config/routes.rb:2:in `block in <top (required)>'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `instance_exec'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in `eval_block'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in `draw'
from C:/row/dev/a/config/routes.rb:1:in `<top (required)>'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `each'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:in `reload!'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `call'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in `execute'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:27:in `updater'
from C:131071:in `execute_if_updated'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from C:/row/Ruby200/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/row/dev/a/config/environment.rb:5:in `<top (required)>'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:189:in `require_environment!'
from C:/row/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.2/lib/rails/commands.rb:44:in `<top (required)>'
from C:/row/dev/a/bin/rails:4:in `require'
from C:/row/dev/a/bin/rails:4:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
For Generating a controller you specified with method name not variable
like
rails generate controller Person index show
I hope you understand and it work for you.
Thanks.
Related
Am following ruby on rails documentation and am hooked here, it dosen't seem to create expected files, i need some help please.
C:\Sites\blog>rails generate controller Comments
i ran the code above but got this instead.
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load': C:/Sites/blog/config/routes.rb:10: syntax error, unexpected end-of-input, expecting keyword_end (SyntaxError)
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `block in load'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:286:in `load'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `block in load_paths'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:55:in `load_paths'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:18:in `reload!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:41:in `block in updater'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.1.4/lib/active_support/file_update_checker.rb:81:in `execute'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:42:in `updater'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/routes_reloader.rb:31:in `execute_if_updated'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:128:in `block in <module:Finisher>'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `call'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
from C:/Sites/blog/config/environment.rb:5:in `<top (required)>'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/application.rb:329:in `require_environment!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/actions.rb:16:in `require_application_and_environment!'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/generate/generate_command.rb:19:in `perform'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
- List item
Please help me, and is documentation the best place for learning rails
Your routes.rb has an error in it somewhere. Backup your existing routes.rb file and then change it to,
Rails.application.routes.draw do
end
Then run your generate command. Afterwards, add the previous contents back into routes.rb
I'm following Michael Hartl's Ruby on Rails Tutorial using nitrous.io. Right now I'm trying to make use of the scaffold command and it's returning a NoMethodError. I'm very new to coding so I'm not sure of the cause of the error but here's exactly what's happening:
~/workspace/rails_projects/demo_app(master)$ rails generate scaffold User name:string email:string
/home/action/workspace/rails_projects/demo_app/config/environments/development.rb:1:in `<top (required)>': undefined method `configure' for #<DemoAppp::Application:0x007fa3572a63e8> (NoMethodError)
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `block in require'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
from /home/action/.gem/ruby/2.1.1/gems/activesupport-4.0.5/lib/active_support/dependencies.rb:229:in `require'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `instance_exec'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:30:in `run'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:44:in `tsort_each_child'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `call'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /home/action/.parts/packages/ruby2.1/2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/initializable.rb:54:in `run_initializers'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:215:in `initialize!'
from /home/action/workspace/rails_projects/demo_app/config/environment.rb:5:in `<top (required)>'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:189:in `require'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/application.rb:189:in `require_environment!'
from /home/action/.gem/ruby/2.1.1/gems/railties-4.0.5/lib/rails/commands.rb:44:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
To me it seems like for some reason the path for development.rb is not the right one, but I'm just guessing.
This can result from namespacing issues in your environment. Your app is called DemoAppp (note the three "p"s), so ensure that your naming convention adheres to the following:
# app/config/initializers/development.rb
DemoAppp::Application.configure do
Alternatively, if it's possible that DemoAppp is a misspelling, you may want to replace DemoAppp with DemoApp with two "p"s.
So I was working on Rails and getting a bit frustrated with my user model so I destroyed it (I'm also using devise which may be a source of error). In my defense I was tired, frustrated, and a bit on the tipsy side. I tried to add it back in with a simple rails g scaffold user first:text last:text, but I get the following error when trying to generate the model. How do I fix this all back up?
/home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `const_get': uninitialized constant User (NameError)
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `each'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `inject'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/inflector/methods.rb:224:in `constantize'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:285:in `get'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:77:in `to'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:72:in `modules'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:89:in `routes'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:156:in `default_used_route'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/mapping.rb:66:in `initialize'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:319:in `new'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise.rb:319:in `add_mapping'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:210:in `block in devise_for'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:209:in `each'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/devise-3.1.1/lib/devise/rails/routes.rb:209:in `devise_for'
from /home/action/workspace/surrigo/config/routes.rb:2:in `block in <top (required)>'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'
from /home/action/workspace/surrigo/config/routes.rb:1:in `<top (required)>'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/action/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/action/workspace/surrigo/config/environment.rb:13:in `<top (required)>'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
from /home/action/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:45:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Remove the line devise_for :users from routes.rb and try running rails g scaffold user first:text last:text. It should work fine.
The devise_for method expects User model to be present. Hence, it fails on loading the rails environment when you run the rails scaffold command
Maybe you have conflicts with naming conventions?
Try
rails g scaffold User first:text last:text
instead.
You are generating a model for the class User (Classes are Capitalized CamelCase in Ruby)
I'm trying to use 'rails generate devise model1' in rails 4, but the following error up.
> /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:229:in `default_controller_and_action': missing :controller (ArgumentError)
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:116:in `normalize_options!'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:64:in `initialize'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1438:in `new'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1438:in `add_route'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1417:in `decomposed_match'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1398:in `block in match'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1389:in `each'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1389:in `match'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:330:in `root'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/mapper.rb:1459:in `root'
from /home/p4/rails_tut/test_app/config/routes.rb:3:in `block in <top (required)>'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `instance_exec'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:316:in `eval_block'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.0/lib/action_dispatch/routing/route_set.rb:294:in `draw'
from /home/p4/rails_tut/test_app/config/routes.rb:1:in `<top (required)>'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `each'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `call'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/file_update_checker.rb:75:in `execute'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:27:in `updater'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /home/p4/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/p4/rails_tut/test_app/config/environment.rb:5:in `<top (required)>'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
from /home/p4/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/commands.rb:45:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have no idea what this the internal working of rails is as this error seem to be some problem coming from 'mapping.rb'.
The following it my routes.rb
TestApp::Application.routes.draw do
root 'dunbs' => 'dunbs#index'
end
Your syntax for defining a root route is incorrect, it should be either root to: 'dunbs#index' or root 'dunbs#index'.
See http://guides.rubyonrails.org/routing.html#using-root for more details.
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.