Re: Restful Authentication with all the bells and whistles (new 9/05/08)

installed git for windows, managed to get this up and running real easily. Nicely made, very impressive. As many others have said, thanks for creating this smile

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Hi,I'm a neewwwbie.  I got everything working and running on my browser.. except I dunno how to test this.
Is this somewhere in the folder to set admin account and invitation code? Thank you

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I also would like to know if I have set up my gmail account right under config. Seems that the email has never been working

development:
  settings:
    name: Your Application
    domain: localhost:3000
    session_key: _your_application_session
    secret: 1138371c71fe2f4f6769090e9fa0d7314b4febcc1c1966f9c83e16a3c880e0ca396cbb37e9ce53bbefc2417cb7363d7127200d51f16b9aeda033dbc3600c63fc
    forgery: b8029fa60066bb90d7fb4e68265a112b
    admin_email: whatever@gmail.com
    in_beta: true
    new_user_invite_limit: 5
    max_user_invite_limit: 100
  rest_auth:
    site_key: e587f9d09baa59c920b9ee97ac70f58b3c51356c
    stretches: 10
  mail:
    address: smtp@gmail.com
    port: 465
    domain: gmail.com
    authentication: :login
    user_name: whatever
    password: blah
    sender: donotreply@yourapplication.com
  recaptcha:
    publickey:
    privatekey:

364

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

+1 on not getting far testing this, in particular I can't figure
out how to set up the fixtures for the User, Permission, and Role
models to I can assign roles to users in the fixtures.

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Thanks for the code! I've been following the setup instructions, and everything worked fine until I ran "rake db:migrate." Then it failed with this message:

rake aborted!
undefined method 'select' for class 'ActiveRecord::ConnectionAdapters::MysqlAdapter'

Can anyone tell me what this means?

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Well, after googling some more I ran across a blog entry by someone who got the same error message after switching from mysql to sqlite (which is what I'm using), and who got the migration to work by deleting the query_analyzer plugin. I tried that and it seems to be working.

367

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I can get this to work fine on my local machine.  However when I attempt to run it with my hosted account, I am unable to rake the db.

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `[]' for nil:NilClass
/home/airspac/nihao/restful_authentication_tutorial/config/environment.rb:62
/home/airspac/nihao/restful_authentication_tutorial/config/../vendor/rails/railties/lib/initializer.rb:111:in `run'
/home/airspac/nihao/restful_authentication_tutorial/config/environment.rb:17
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/home/airspac/nihao/restful_authentication_tutorial/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/home/airspac/nihao/restful_authentication_tutorial/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/home/airspac/nihao/restful_authentication_tutorial/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/home/airspac/nihao/restful_authentication_tutorial/vendor/rails/railties/lib/tasks/misc.rake:4
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19

Last edited by chief (2009-08-12 18:53:44)

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Trying to integrate this into an application im building, and running into some issues when trying to use script/console to edit my current user account (I had a user model before grabbing the restfulauthentication). Heres my error output. I do have the include AuthenticatedSystem in my application controller.

Loading development environment (Rails 2.3.3)
/usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require':LoadError: no such file to load -- readline
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:105:in `rescue in const_missing': uninitialized constant ApplicationController::AuthenticatedSystem (NameError)
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:94:in `const_missing'
  from /home/aaron/Documents/booklist/booklist/app/controllers/application_controller.rb:7:in `<class:ApplicationController>'
  from /home/aaron/Documents/booklist/booklist/app/controllers/application_controller.rb:4:in `<top (required)>'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:380:in `load'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:380:in `block in load_file'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:379:in `load_file'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:259:in `require_or_load'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:425:in `load_missing_constant'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:92:in `const_missing'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/console_with_helpers.rb:5:in `<top (required)>'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `block in require'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `block in load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `each'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
  from /usr/local/lib/ruby/1.9.1/irb.rb:53:in `start'
  from /usr/local/bin/irb:12:in `<main>'
aaron@aaron-laptop:~/Documents/booklist/booklist$ script/console
Loading development environment (Rails 2.3.3)
/usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require':LoadError: no such file to load -- readline
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant APP_CONFIG (NameError)
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:92:in `const_missing'
  from /home/aaron/Documents/booklist/booklist/config/initializers/mail.rb:4:in `<top (required)>'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `load'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `block in load_with_new_constant_marking'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:622:in `block in load_application_initializers'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:621:in `each'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:621:in `load_application_initializers'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:176:in `process'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:113:in `run'
  from /home/aaron/Documents/booklist/booklist/config/environment.rb:9:in `<top (required)>'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `require'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `block in load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `each'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
  from /usr/local/lib/ruby/1.9.1/irb.rb:53:in `start'
  from /usr/local/bin/irb:12:in `<main>'
aaron@aaron-laptop:~/Documents/booklist/booklist$ script/console
Loading development environment (Rails 2.3.3)
/usr/local/lib/ruby/1.9.1/irb/completion.rb:9:in `require':LoadError: no such file to load -- readline
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:443:in `load_missing_constant': uninitialized constant APP_CONFIG (NameError)
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:92:in `const_missing'
  from /home/aaron/Documents/booklist/booklist/config/initializers/mail.rb:4:in `<top (required)>'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `load'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `block in load_with_new_constant_marking'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in'
  from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:145:in `load_with_new_constant_marking'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:622:in `block in load_application_initializers'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:621:in `each'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:621:in `load_application_initializers'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:176:in `process'
  from /usr/local/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/initializer.rb:113:in `run'
  from /home/aaron/Documents/booklist/booklist/config/environment.rb:9:in `<top (required)>'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `require'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:262:in `block in load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `each'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:260:in `load_modules'
  from /usr/local/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
  from /usr/local/lib/ruby/1.9.1/irb.rb:53:in `start'
  from /usr/local/bin/irb:12:in `<main>'

Thanks

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Tried to get the restful app itself working, rather than my own. I edited the database.yml file, and I could not run the rake db:create, heres the error:

no such file to load -- spec/rake/spectask
/home/aaron/Documents/rails/restful_authentication_tutorial/Rakefile:10:in `require'

I did however manage to fix my previous error. Added a couple lines from the given environment file to mine, and grabbed the config.yml. smile

Last edited by agm_ultimatex (2009-08-16 12:36:09)

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I had installed the Exception Logger plugin, but it don't work, no enteries in the database. I get no error or message from the plugin...o.O.
Someone any idea?

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

agm_ultimatex wrote:

Tried to get the restful app itself working, rather than my own. I edited the database.yml file, and I could not run the rake db:create, heres the error:

no such file to load -- spec/rake/spectask
/home/aaron/Documents/rails/restful_authentication_tutorial/Rakefile:10:in `require'

I did however manage to fix my previous error. Added a couple lines from the given environment file to mine, and grabbed the config.yml. smile

Managed to fix that. If you have the same problem, change line 7 in the rspec.rake file under lib/tasks to:

rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/gems/rspec-1.1.12/lib')

That way it points to the installed gem rather than a non-existent plugin folder. Thanks to Adam Salter's comment on http://jimneath.org/2008/09/09/bort-bas … plication/

Last edited by agm_ultimatex (2009-08-20 12:58:53)

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Hi, I'm new to Rails and restful authentication.

I'm following the tutorial, when I get to the setup database.yml part and I attempt to install the mysql gem I get this error.

ERROR:  Error installing mysql:
  ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
extconf.rb:10: command not found: /usr/local/mysql/bin/mysql_config --cflags
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  --with-mysql-config


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

I'm running on Leopard, so I'm using the Leopard command shown in the database sample

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Thanks for any help.

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

In addition to my problem with mysql above, I don't see where I make the change to application.rb as explained in the tutorial.

-Change contact_site method in application.rb to redirect to your site's contact form or info

I see three files named application.rb and none have a method called contact_site.

Thanks.

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Found the answer to my second question about application.rb, it is in the application_controller.rb.

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I still can't get restful_authentication running and my project is behind, any advice would be grateful. I was able to install mysql but now when I run script/server I get this error.

=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `real_connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) (Mysql::Error)
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:576:in `connect'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:204:in `initialize'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:76:in `new'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:76:in `mysql_connection'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
   ... 26 levels...
  from /Applications/MAMP/htdocs/Rails/restful_authentication_tutorial/vendor/rails/railties/lib/commands/server.rb:84
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
  from script/server:3

I'm wondering if it is a socket configuration problem. I tried to run "mysql_config --socket" but the console gives me this

-bash: mysql_config: command not found

Last edited by boilerpa (2009-09-12 22:56:28)

376

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I'm having a bit of a strange issue.  I have the tutorial installed and functioning perfectly, except that it takes my system about 60 seconds to process when creating a new user.  Besides this long delay in creating a user, everything works great.

I'm on a fast machine and not seeing any delays besides this issue.  I've been testing the app extensively for 2 days and not having any other issues.  Not getting any errors in the log either.

It just takes about 60 seconds to process a new user and send the activation email.  Has anybody else had this problem?  Any ideas about what might be causing this?

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

Hi there,
I getting a migration error when trying to set up the tutorial.

db:create works fine, but db:migrate throws:

rake aborted!
Mysql::Error: Error on rename of './test_development/schema_migrations' to './test_development/#sql2-22d3-c' (errno: -1): CREATE UNIQUE INDEX `unique_schema_migrations` ON `schema_migrations` (`version`)

I can't seem to track down the problem, can anyone point me in the right direction. I'm running Mac OS 10.5, MySQL 5.1.34 and Rails 2.3.4

Any help would be much appreciated,

Kieran

Last edited by kieranmasterton (2009-11-07 18:45:29)

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I can't seem to get this running either. Is the package and tutorial still viable for v2.3.4?

I set this up as a project in Aptana Rails and it reports "No Rake Tasks found. Likely cause is no Rakefile for project." Of course, there is a rake file.

Starting the server gives me this error:

C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- ./script/../config/../vendor/rails/railties/lib/initializer (LoadError)
  from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  from ./script/../config/boot.rb:45:in `load_initializer'
  from ./script/../config/boot.rb:38:in `run'
  from ./script/../config/boot.rb:11:in `boot!'
  from ./script/../config/boot.rb:110
  from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
  from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  from ./script/server:2
  from -e:2:in `load'
  from -e:2

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

I started on a project using this a few months ago and had to set it aside.  Just picked it up again and started going back through the code and found that the activation link sent after successful account creating doesn't work.  When I look in the database, the activation code is different from what's being emailed.  Any ideas what's happening or where to look?

Here's my debug log:

Processing UsersController#create (for 127.0.0.1 at 2009-11-20 14:43:30) [POST]
  Parameters: {"user"=>{"name"=>"Fred", "password_confirmation"=>"[FILTERED]", "password"=>"[FILTERED]", "login"=>"Fred", "email"=>"fred@fred.com"}, "commit"=>"Sign up", "action"=>"create", "authenticity_token"=>"2GDdzWkK+RybMkcE3NSpLUhQA8adZME9fD6WsWbiM14=", "controller"=>"users"}
  [4;35;1mUser Columns (10.0ms)[0m   [0mSHOW FIELDS FROM `users`[0m
  [4;36;1mUser Load (0.0ms)[0m   [0;1mSELECT `users`.id FROM `users` WHERE (LOWER(`users`.`login`) = BINARY 'fred') LIMIT 1[0m
  [4;35;1mUser Load (0.0ms)[0m   [0mSELECT `users`.id FROM `users` WHERE (LOWER(`users`.`email`) = BINARY 'fred@fred.com') LIMIT 1[0m
  [4;36;1mSQL (0.0ms)[0m   [0;1mBEGIN[0m
  [4;35;1mUser Create (0.0ms)[0m   [0mINSERT INTO `users` (`name`, `salt`, `updated_at`, `activated_at`, `crypted_password`, `deleted_at`, `remember_token_expires_at`, `activation_code`, `password_reset_code`, `updated_by`, `remember_token`, `login`, `email`, `created_at`, `state`) VALUES('Fred', '3bbb29ee289da0cebb2098cbefc44dcffcce2711', '2009-11-20 20:43:30', NULL, '21f0bfd69d7f5826d46db650ac9a33a33a0d3909', NULL, NULL, '1e49dff90d979b2f8e9145a588a6ff673fdafb13', NULL, NULL, NULL, 'Fred', 'fred@fred.com', '2009-11-20 20:43:30', 'pending')[0m
Sent mail to fred@fred.com

Date: Fri, 20 Nov 2009 14:43:30 -0600

From: admin@mydomain.com

To: fred@fred.com

Subject: Please activate your new account

Mime-Version: 1.0

Content-Type: text/plain; charset=utf-8



Your account has been created.

  Username: Fred
  Password: 123456

Visit this url to activate your account:

  http://localhost:3000/activate/4441833e2ad6c7fe8513634c0b3c0777bfe01bb4



SOLVED:  Found the answer:  Need to include "user.reload" in the user_observer after_create definition

Last edited by Hankster (2009-11-30 15:42:28)

Re: Restful Authentication with all the bells and whistles (new 9/05/08)

@rbruhn
I had this running on 2.2 a few months back.  Just built a 2.3.4 environment, moved the database and the code and the only change I had to make was renaming the application.rb controller file to application_controller.rb.  However, I'm running it in an XP environment.