NoMethod error. rediredct_to undefined

Pleas help. This is the log when I try to run the rails server.

Thanks!!

/home/naman/Desktop/multiple_image_upload_carrierwave/config/routes.rb:3:in
block in <top (required)>': undefined methodredirect_to’ for
#ActionDispatch::Routing::Mapper:0x00000005857730 (NoMethodError)
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in
instance_exec' from /home/naman/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:ineval_block’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:319:in
draw' from /home/naman/Desktop/multiple_image_upload_carrierwave/config/routes.rb:1:in<top (required)>’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in
load' from /home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:inblock in load’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in
load_dependency' from /home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:inload’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in
block in load_paths' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:ineach’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:40:in
load_paths' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:16:inreload!’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:26:in
block in updater' from /home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:incall’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/file_update_checker.rb:75:in
execute' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:27:inupdater’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/routes_reloader.rb:6:in
execute_if_updated' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application/finisher.rb:69:inblock in module:Finisher
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in
instance_exec' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:inrun’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in
block in run_initializers' from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:inblock in tsort_each’
from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in
block (2 levels) in each_strongly_connected_component' from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:ineach_strongly_connected_component_from’
from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in
block in each_strongly_connected_component' from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:ineach’
from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in
call' from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:ineach_strongly_connected_component’
from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in
tsort_each' from /home/naman/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:intsort_each’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in
run_initializers' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:ininitialize!’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in
method_missing' from /home/naman/Desktop/multiple_image_upload_carrierwave/config/environment.rb:5:in<top (required)>’
from
/home/naman/Desktop/multiple_image_upload_carrierwave/config.ru:3:in
require' from /home/naman/Desktop/multiple_image_upload_carrierwave/config.ru:3:inblock in ’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in
instance_eval' from /home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:ininitialize’
from
/home/naman/Desktop/multiple_image_upload_carrierwave/config.ru:in new' from /home/naman/Desktop/multiple_image_upload_carrierwave/config.ru:in
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in
eval' from /home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:innew_from_string’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in
parse_file' from /home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:inbuild_app_and_options_from_config’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in
app' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:inapp’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in
wrapped_app' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:instart’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in
block in <top (required)>' from /home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:intap’
from
/home/naman/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in
<top (required)>' from bin/rails:4:inrequire’
from bin/rails:4:in `’

Show us the contents of your config/routes.rb. From the error, it looks
like you are using a redirect in that file which is not correct.
Redirect logic should go elsewhere.

On Saturday, 5 April 2014 15:53:25 UTC-4, Ruby-Forum.com User wrote:

/home/naman/.rvm/gems/ruby-2.1.0/gems/actionpack-4.0.2/lib/action_dispatch/routing/route_set.rb:341:in

`instance_exec’

Hard to say without actually seeing config/routes.rb, but I suspect
you’re
looking for the ‘redirect’ method in the routing DSL, not ‘redirect_to’:

http://api.rubyonrails.org/classes/ActionDispatch/Routing/Redirection.html#method-i-redirect

–Matt J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs