# Error when calling redirect\_to (NoMethodError (undefined method \`uri\_https\_url' for #\<InvitesContro

**URL:** <https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887>\
**Category:** Rails\
**Created:** [April 15, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887 "2008-04-15T23:09:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stubbsuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@stubbsuk](https://www.ruby-forum.com/u/stubbsuk)\
**Post date:** [April 15, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887/1 "2008-04-15T23:09:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stubbsuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@stubbsuk](https://www.ruby-forum.com/u/stubbsuk)\
**Post date:** [April 16, 2008, 12:49am UTC](https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887/2 "2008-04-16T00:49:13Z")

</div>

Could you post the code that is generating the stack?

On Apr 15, 2:08 pm, Stuart Grimshaw [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![stubbsuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@stubbsuk](https://www.ruby-forum.com/u/stubbsuk)\
**Post date:** [April 17, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887/3 "2008-04-17T22:22:41Z")

</div>

On 15 Apr, 23:48, “removed\_email\_address@domain.invalid” \<ESPN3.DL-  
removed\_email\_address@domain.invalid\> wrote:

> Could you post the code that is generating the stack?

I’m using the Ruby Google Authsub plugin[1] from Stuart C., 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](http://ft.stuartgrimshaw.co.uk)’,  
:scope\_url =\> ‘[http://www.google.com/m8/feeds/](http://www.google.com/m8/feeds/)’,  
:secure =\> false )

```
redirect_to auth.request_url

```

end

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

---

<div class="post-metadata">

**Author:** ![stubbsuk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@stubbsuk](https://www.ruby-forum.com/u/stubbsuk)\
**Post date:** [October 5, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/error-when-calling-redirect-to-nomethoderror-undefined-method-uri-https-url-for-invitescontro/134887/4 "2008-10-05T21:03:06Z")

</div>

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 G. wrote:

> On 15 Apr, 23:48, “removed\_email\_address@domain.invalid” \<ESPN3.DL-  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > Could you post the code that is generating the stack?
> 
> I’m using the Ruby Google Authsub plugin[1] from Stuart C., 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](http://ft.stuartgrimshaw.co.uk)’,  
> :scope\_url =\> ‘[http://www.google.com/m8/feeds/](http://www.google.com/m8/feeds/)’,  
> :secure =\> false )
> 
> ```
> redirect_to auth.request_url
> 
> ```
> 
> end
> 
> [1] [http://www.cybertherial.com/weblog/?p=16](http://www.cybertherial.com/weblog/?p=16)
