Human Target
2006-Aug-07 05:44 UTC
[Rails] 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! -- Posted via http://www.ruby-forum.com/.
Warren Noronha
2006-Aug-07 06:05 UTC
[Rails] NoMethod Error: Modifying Location of support modules
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 > endits Digest::SHA1.hexdigest(password) not Digest:SHA1.hexdigest Warren Brian Noronha
Bit Detective
2006-Aug-07 16:06 UTC
[Rails] Re: NoMethod Error: Modifying Location of support modules
My bad :) Thanks. Warren Noronha 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-- Posted via http://www.ruby-forum.com/.