NoMethod Error: Modifying Location of support modules

I’m trying to follow along with the Agile Development with Ruby on Rails
book and have encountered a problem with code having the following
syntax (partial class provided):

require “digest/sha1”

class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end

I’m getting an error as:
undefined method `hexdigest’ for :SHA1:Symbol

I have installed Ruby 1.8.4. How can I correct this error? I’m running
on Mac OS X and have followed the build instructions for Macs to install
this version of Ruby. If I need to manually move library/module files
please point me to instructions as to how.

Thanks!

On Aug 7, 2006, at 11:14 AM, Human Target wrote:

require “digest/sha1”

class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end

its Digest::SHA1.hexdigest(password) not Digest:SHA1.hexdigest

Warren Brian Noronha

My bad :slight_smile: Thanks.

Warren N. wrote:

On Aug 7, 2006, at 11:14 AM, Human Target wrote:

require “digest/sha1”

class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end

its Digest::SHA1.hexdigest(password) not Digest:SHA1.hexdigest

Warren Brian Noronha