Forum: Rails Engines Problem with forgotten password

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
David C. (Guest)
on 2006-03-22 02:57
(Received via mailing list)
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: <div title="<%= title_helper %>" class="form">
2:   <h3>Forgotten Password</h3>
3:
4:   <%= error_messages_for 'user' %>
5:
6:   <div class="form-padding">
7:     <p>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.</p>

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
Steve K. (Guest)
on 2006-03-22 14:58
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 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: <div title="<%= title_helper %>" class="form">
> 2:   <h3>Forgotten Password</h3>
> 3:
> 4:   <%= error_messages_for 'user' %>
> 5:
> 6:   <div class="form-padding">
> 7:     <p>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.</p>
>
> 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
David C. (Guest)
on 2006-03-23 02:05
(Received via mailing list)
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 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?
David C. (Guest)
on 2006-03-23 02:11
(Received via mailing list)
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.
Steve K. (Guest)
on 2006-03-23 21:38
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.
David C. (Guest)
on 2006-03-24 01:35
(Received via mailing list)
OK.  It turns out (I think) , it was failure to properly configure the
action_mailer for the production environment.

Thanks though.
This topic is locked and can not be replied to.