Error when calling redirect_to (NoMethodError (undefined method `uri_https_url' for #<InvitesController:0x356a9d4>):)

Here's the full stack trace of the problem, I'm assuming uri_https_url
is constructed somehow? I'm stumped.

NoMethodError (undefined method `uri_https_url' for
#<InvitesController:0x356a9d4>):
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/polymorphic_routes.rb:27:in `send!'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/polymorphic_routes.rb:27:in `polymorphic_url'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:618:in `url_for'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:1060:in `redirect_to'
    /app/controllers/invites_controller.rb:40:in `google_auth'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:1158:in `send'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:1158:in `perform_action_without_filters'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/filters.rb:697:in `call_filters'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/filters.rb:689:in `perform_action_without_benchmark'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
    /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/rescue.rb:199:in `perform_action_without_caching'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/caching.rb:678:in `perform_action'
    /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/
active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
    /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/
active_record/query_cache.rb:8:in `cache'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/caching.rb:677:in `perform_action'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:524:in `send'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:524:in `process_without_filters'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/filters.rb:685:in
`process_without_session_management_support'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/session_management.rb:123:in `process'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/base.rb:388:in `process'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/dispatcher.rb:171:in `handle_request'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/dispatcher.rb:115:in `dispatch'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/dispatcher.rb:126:in `dispatch_cgi'
    /opt/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/
action_controller/dispatcher.rb:9:in `dispatch'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/
rails.rb:76:in `process'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/
rails.rb:74:in `synchronize'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/../lib/mongrel/
rails.rb:74:in `process'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
159:in `process_client'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
158:in `each'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
158:in `process_client'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
285:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
285:in `initialize'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
285:in `new'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
285:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
268:in `initialize'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
268:in `new'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:
268:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/
configurator.rb:282:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/
configurator.rb:281:in `each'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/
configurator.rb:281:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:
128:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/
command.rb:212:in `run'
    /opt/local/lib/ruby/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:
281
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:489:in `load'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:489:in `load'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:342:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:489:in `load'
    /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/
mongrel.rb:64
    /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
    /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:496:in `require'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:342:in `new_constants_in'
    /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/
active_support/dependencies.rb:496:in `require'
    /opt/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/
server.rb:39
    /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:
27:in `gem_original_require'
    /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:
27:in `require'
    script/server:3

Could you post the code that is generating the stack?

I'm using the Ruby Google Authsub plugin[1] from Stuart Coyle, it's a
very early beta, and I'm just trying to follow the README file.

  def google_auth
    auth = GoogleAuthSub.new(:next_url => ‘http://
ft.stuartgrimshaw.co.uk’,
      :scope_url => ‘http://www.google.com/m8/feeds/’,
      :secure => false )

    redirect_to auth.request_url
  end

[1] http://www.cybertherial.com/weblog/?p=16

Hi I just came across this bug too with authsub. I went up the stack and
traced it to the polymorphic url generated by the url_for function. The
URI::HTTPS class, (which is only about 2 lines of code in my edition of
rails) may have been enhanced in a version later than rails 2.1.0 to
include a uri_https_url function. (URI:HTTP contains what looks to be an
analog of this - request_uri)

In any case, I'm not sure whether the HTTPS class in rails 2.1.0 is out
of sync with the one that the authsub plugin was built with, or if there
is an extra parameter that needs to be passed, etc.. However, there is a
simple fix. Just put this in your controller:

  def uri_https_url (request_path)
    request_path.to_s
  end

Best,
Ismail Degani

Stuart Grimshaw wrote: