Issue with authentication

Hi All,

I am a newbie and playing around with restful_authentication in my
sample
app. The associated code for user.rb is pasted below. When I try to run
the
server, i get the following error. I am using Rails 2.0.2. Could anyone
point me as to what am i missing?

Line no 66: # Encrypts some data with the salt.
Line no 67: def self.encrypt(password, salt)
Line no 68: Digest::SHA1.hexdigest(“–#{salt}–#{password}–”)
Line no 69: end

################################################

[email protected]:~/rails/sample$ script/server
=> Booting WEBrick…
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:in
load_without_new_constant_marking': /home/user/rails/sample/app/models/user.rb:69: syntax error, unexpected kEND, expecting ')' (SyntaxError) /home/user/rails/sample/app/models/user.rb:96: syntax error, unexpected tIDENTIFIER, expecting ')' save(false) ^ /home/user/rails/sample/app/models/user.rb:160: syntax error, unexpected $end, expecting kEND from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:203:inload_file’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:342:in
new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:202:inload_file’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:94:in
require_or_load' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:248:inload_missing_constant’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:453:in
const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/dependencies.rb:465:inconst_missing’
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/inflector.rb:257:in
constantize' ... 25 levels... from /usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb:39 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
from script/server:3

It seems to be a syntax error. Somewhere you may have missed out a
bracket.
Better you copy and paste the full user.rb code here.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs