# Unable to log in as for Depot Application

**URL:** <https://www.ruby-forum.com/t/unable-to-log-in-as-for-depot-application/106584>\
**Category:** Rails\
**Created:** [June 12, 2007, 7:00am UTC](https://www.ruby-forum.com/t/unable-to-log-in-as-for-depot-application/106584 "2007-06-12T07:00:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pacochin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9fc29f/32.png) [@pacochin](https://www.ruby-forum.com/u/pacochin)\
**Post date:** [June 12, 2007, 7:00am UTC](https://www.ruby-forum.com/t/unable-to-log-in-as-for-depot-application/106584/1 "2007-06-12T07:00:34Z")

</div>

Hi,

Sorry, I am not sure where to ask the question. I was following the  
book Agile Web D. tutorial about creating Admin users login  
for to manage the products. I have successfully created new user, but  
when i try to login in, i have this error message…

=============  
TypeError in LoginController#login

can’t convert String into Array

RAILS\_ROOT: C:/INSTAN~1/rails\_apps/depot/config/…  
Application Trace | Framework Trace | Full Trace

#{RAILS\_ROOT}/app/models/user.rb:43:in `+' #{RAILS_ROOT}/app/models/user.rb:43:in`encrypted\_password’  
#{RAILS\_ROOT}/app/models/user.rb:29:in `authenticate' #{RAILS_ROOT}/app/controllers/login_controller.rb:15:in`login’

C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:1095:in `send' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:1095:in`perform\_action\_without\_filters’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/filters.rb:632:in `call_filter' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/filters.rb:619:in`perform\_action\_without\_benchmark’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/rescue.rb:83:in`perform\_action’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:430:in `send' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:430:in`process\_without\_filters’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/filters.rb:624:in  
`process_without_session_management_support' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/session_management.rb:114:in`process’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:330:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb: 41:in`dispatch’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/rails.rb:78:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/rails.rb:76:in`synchronize’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/rails.rb:76:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:618:in`process\_client’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:617:in `each' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:617:in`process\_client’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:736:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:736:in`initialize’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:736:in `new' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:736:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:720:in `initialize' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:720:in`new’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:720:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/configurator.rb:271:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/configurator.rb:270:in `each' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/configurator.rb:270:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/  
mongrel\_rails:127:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/command.rb:211:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/  
mongrel\_rails:243  
C:/INSTAN~1/ruby/bin/mongrel\_rails:16:in `load’  
C:/INSTAN~1/ruby/bin/mongrel\_rails:16

#{RAILS\_ROOT}/app/models/user.rb:43:in `+' #{RAILS_ROOT}/app/models/user.rb:43:in`encrypted\_password’  
#{RAILS\_ROOT}/app/models/user.rb:29:in `authenticate' #{RAILS_ROOT}/app/controllers/login_controller.rb:15:in`login’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:1095:in `send' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:1095:in`perform\_action\_without\_filters’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/filters.rb:632:in `call_filter' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/filters.rb:619:in`perform\_action\_without\_benchmark’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1/ruby/lib/ruby/1.8/benchmark.rb:293:in`measure’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/benchmarking.rb:66:in  
`perform_action_without_rescue' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/rescue.rb:83:in`perform\_action’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:430:in `send' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/base.rb:430:in`process\_without\_filters’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/filters.rb:624:in  
`process_without_session_management_support' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/session_management.rb:114:in`process’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/  
action\_controller/base.rb:330:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb: 41:in`dispatch’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/rails.rb:78:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/rails.rb:76:in`synchronize’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/rails.rb:76:in `process' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:618:in`process\_client’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:617:in `each' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:617:in`process\_client’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:736:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:736:in`initialize’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:736:in `new' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:736:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:720:in `initialize' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel.rb:720:in`new’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel.rb:720:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/configurator.rb:271:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/  
mongrel/configurator.rb:270:in `each' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/configurator.rb:270:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/  
mongrel\_rails:127:in `run' C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/lib/ mongrel/command.rb:211:in`run’  
C:/INSTAN~1/ruby/lib/ruby/gems/1.8/gems/mongrel-1.0.1-mswin32/bin/  
mongrel\_rails:243  
C:/INSTAN~1/ruby/bin/mongrel\_rails:16:in `load’  
C:/INSTAN~1/ruby/bin/mongrel\_rails:16

Request

Parameters: {“name”=\>“paco”, “commit”=\>“Login”, “password”=\>“12345”}

Show session dump

* * *

:user\_id:  
flash: !map:ActionController::Flash::FlashHash {}

# Response Headers: {“cookie”=\>[], “Cache-Control”=\>“no-cache”}

very strange. attached is my model/user.rb file. I did another test,  
to try to use a wrong username, i got a response saying “Invalid user/  
password combination”

So, looks like the

def self.encrypted\_password(password, salt)  
string\_to\_hash = password + “wibble” + salt  
Digest::SHA1.hexdigest(string\_to\_hash)  
end

string\_to\_hash gives me error !

Please help or point me to the right direction to solve this  
issue…otherwise, i can not proceed with the rest of the  
chapters…

I am using Window XP and InstantRails to develop this application,  
using MYSQL.

your help is greatly appreciated !  
thks
