# Problem with forgotten password

**URL:** <https://www.ruby-forum.com/t/problem-with-forgotten-password/55554>\
**Category:** Engines\
**Created:** [March 22, 2006, 1:57am UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554 "2006-03-22T01:57:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 22, 2006, 1:57am UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/1 "2006-03-22T01:57:55Z")

</div>

I’m getting the following problem after entering my email in the  
"forgotten  
password’ form. But, oddly it only happens in production mode, not  
development mode. Any ideas?

—cut----  
undefined method `errors’ for nil:NilClass

Extracted source (around line #4):

1:

  
2: 
### Forgotten Password
  
3:  
4: \<%= error\_messages\_for ‘user’ %\>  
5:  
6: 
  
7: 

Enter your email address in the field below and click ‘Reset  
Password’ to have instructions on how to retrieve your forgotten  
password  
emailed to you.

RAILS\_ROOT: script/…/config/…  
Application Trace | Framework Trace | Full Trace

./script/…/config/…/vendor/rails/actionpack/lib/action\_view/helpers/active\_record\_helper.rb:106:in  
`error_messages_for' #{RAILS_ROOT}/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml:4 ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:268:in`compile\_and\_render\_template’  
./script/…/config/…/vendor/rails/actionpack/lib/action\_view/base.rb:244:in  
`render_template' ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:205:in`render\_file’  
./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/base.rb:655:in  
`render_file' ./script/../config/../vendor/rails/actionpack/lib/action_controller/base.rb:595:in`render\_with\_no\_layout’  
./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/layout.rb:220:in  
`render_without_benchmark' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in`render’  
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in`render’  
./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/base.rb:854:in  
`perform\_action\_without\_filters’  
./script/…/config/…/vendor/rails/actionpack/lib/action\_contr

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 22, 2006, 1:58pm UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/2 "2006-03-22T13:58:17Z")

</div>

Does the path to the application on your production server contain any  
hyphens or other punctuation characters? There’s a problem that was just  
fixed in the trunk of the Engines plugin.

See [UserEngine Bug #53 biting me - Engines - Ruby-Forum](http://www.ruby-forum.com/topic/58373)

The same thing was happening to me and this seems to have fixed it  
completely.

It’s a one-line change to one file in the Engines plugin so it’s pretty  
easy to test without having to install an entirely new version.

-sk

David C. wrote:

> I’m getting the following problem after entering my email in the  
> "forgotten  
> password’ form. But, oddly it only happens in production mode, not  
> development mode. Any ideas?
> 
> —cut----  
> undefined method `errors’ for nil:NilClass
> 
> Extracted source (around line #4):
> 
> 1:
> 
>   
> 2: 
> ### Forgotten Password
>   
> 3:  
> 4: \<%= error\_messages\_for ‘user’ %\>  
> 5:  
> 6: 
>   
> 7: 
> 
> Enter your email address in the field below and click ‘Reset  
> Password’ to have instructions on how to retrieve your forgotten  
> password  
> emailed to you.
> 
> RAILS\_ROOT: script/…/config/…  
> Application Trace | Framework Trace | Full Trace
> 
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_view/helpers/active\_record\_helper.rb:106:in  
> `error_messages_for' #{RAILS_ROOT}/vendor/plugins/login_engine/app/views/user/forgot_password.rhtml:4 ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:268:in `compile\_and\_render\_template’  
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_view/base.rb:244:in  
> `render_template' ./script/../config/../vendor/rails/actionpack/lib/action_view/base.rb:205:in `render\_file’  
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/base.rb:655:in  
> `render_file' ./script/../config/../vendor/rails/actionpack/lib/action_controller/base.rb:595:in `render\_with\_no\_layout’  
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/layout.rb:220:in  
> `render_without_benchmark' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in `render’  
> /usr/lib/ruby/1.8/benchmark.rb:293:in `measure' ./script/../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:53:in `render’  
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_controller/base.rb:854:in  
> `perform\_action\_without\_filters’  
> ./script/…/config/…/vendor/rails/actionpack/lib/action\_contr

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 23, 2006, 1:05am UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/3 "2006-03-23T01:05:51Z")

</div>

On Wednesday 22 March 2006 07:58 am, Steve K. wrote:

> Does the path to the application on your production server contain any  
> hyphens or other punctuation characters? There’s a problem that was just  
> fixed in the trunk of the Engines plugin.
> 
> See [UserEngine Bug #53 biting me - Engines - Ruby-Forum](http://www.ruby-forum.com/topic/58373)
> 
> The same thing was happening to me and this seems to have fixed it  
> completely.

I think I accessed it as “localhost”, which would be ‘no’, but others  
are  
using an IP address. Will the IP address cause the problem too?

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 23, 2006, 1:11am UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/4 "2006-03-23T01:11:47Z")

</div>

On Wednesday 22 March 2006 07:58 am, Steve K. wrote:

> Does the path to the application on your production server contain any  
> hyphens or other punctuation characters? There’s a problem that was just  
> fixed in the trunk of the Engines plugin.

And actually, there is a colon because it’s running on a non standard  
port.

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 24, 2006, 12:35am UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/5 "2006-03-24T00:35:23Z")

</div>

OK. It turns out (I think) , it was failure to properly configure the  
action\_mailer for the production environment.

Thanks though.

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [March 23, 2006, 8:38pm UTC](https://www.ruby-forum.com/t/problem-with-forgotten-password/55554/6 "2006-03-23T20:38:12Z")

</div>

No, not the URL. The path the files are located in.

For instance, maybe your app is in

/usr/local/railsapps/myapp

or if you’re on Windows

c:\railstuff\myapp

If any of the directory names leading up to your application files  
contain a hyphen and possibly some other punctuation characters, that  
would cause a problem like you describe, for which there is a simple fix  
available.

The above directory paths wouldn’t have this problem, but these would:

/usr/local/rails-apps/myapp

or

c:\railstuff\my-app

Get it?

-sk

David C. wrote:

> On Wednesday 22 March 2006 07:58 am, Steve K. wrote:
> 
> > Does the path to the application on your production server contain any  
> > hyphens or other punctuation characters? There’s a problem that was just  
> > fixed in the trunk of the Engines plugin.
> 
> And actually, there is a colon because it’s running on a non standard  
> port.
