Forum: Ruby on Rails Errors using restful-authentication + rubyist-aasm on 2.2.2

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
017beaafb76e579983835c7813a3d624?d=identicon&s=25 Daniele Di Bernardo (marzapower)
on 2008-11-26 11:07
I'm asking for a problem which I cannot find a solution to.

I'm using a freshly installed Debian machine, with lighttpd as web
server, ruby 1.8.5, rubygems 1.3.1, rails 2.2.2.
I'm using both the sqlite3-ruby gem and the mysql gem for the database
connection (same problem verified with both of them).

I just created a new test application, and added the latest relase of
the restful-authentication plugin (found on github, obviously). I
created a new authenticated user structure, using the command:

script/generate authenticated user sessions --include-activation --aasm

preferring the rubyist-aasm plugin over the acts_as_state_machine one.

I started the application through thin, without special configuration
(just thin start).

After I try registering a new user, I get this message:

NoMethodError in UsersController#create

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.call_action

RAILS_ROOT: /www/rails/test
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/aasm-0.0.2/lib/aasm.rb:59:in `register!'
app/controllers/users_controller.rb:18:in `create'
/usr/bin/thin:19:in `load'

Notice: the aasm gem has been installed using the latest release from
the repository on github, compiling the gem locally. I don't know why it
has version number 0.0.2 instead of 2.0.2. By the way, I get the same
error installing the aasm gem from the remote repository (which gives me
a gem number-versioned 2.0.2).

I added two logger.debug calls on the method `aasm_fire_event` for
logging the values of the parameter 'name' sent to the method and the
parameter 'aasm_current_state' used where the method crashes, obtaining:

name = register (without quotes)
aasm_current_state = 'passive' (quoted)

Can it be a problem with the quoted aasm_current_state parameter? Does
anyone has a solution?

Thank you too much!
This topic is locked and can not be replied to.