Mark Haliday
2006-Feb-19 03:56 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
I''ve tried the following line in ruby script/console require ''digest/md5'' Both my Mac (Intel iMac) and my Windows box return "false"... Any ideas what could be wrong? I was trying to do the RoR Recipe on page 54 of Chad Fowler''s new (beta) book. -Mark -- Posted via http://www.ruby-forum.com/.
Mark Haliday
2006-Feb-19 04:06 UTC
[Rails] Re: require ''digest/md5'' not working on Mac or Windows
Mark Haliday wrote:> > require ''digest/md5''Just make a note, I am aware I can just use SHA1 very easily instead, I''m just curious why MD5 doesn''t work. -Mark -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Feb-19 04:07 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Sun, 2006-02-19 at 04:56 +0100, Mark Haliday wrote:> I''ve tried the following line in ruby script/console > > require ''digest/md5'' > > Both my Mac (Intel iMac) and my Windows box return "false"... Any ideas > what could be wrong? I was trying to do the RoR Recipe on page 54 of > Chad Fowler''s new (beta) book. >---- I had that problem too...I think you could probably just substitute sha1 for md5 digest/md5 and elsewhere SHA1 for MD5 Craig
Craig White
2006-Feb-19 04:08 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Sun, 2006-02-19 at 04:56 +0100, Mark Haliday wrote:> I''ve tried the following line in ruby script/console > > require ''digest/md5'' > > Both my Mac (Intel iMac) and my Windows box return "false"... Any ideas > what could be wrong? I was trying to do the RoR Recipe on page 54 of > Chad Fowler''s new (beta) book. >---- and for what it''s worth...I thought that particular recipe was ''half-baked'' since it offered not even the slightest example of view code that you could use to make that work and I spent too much time grappling with it and abandoned it for another time. Craig
Roustem Karimov
2006-Feb-19 04:23 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Sunday, February 19, 2006, at 4:56 AM, Mark Haliday wrote:>I''ve tried the following line in ruby script/console > >require ''digest/md5'' > >Both my Mac (Intel iMac) and my Windows box return "false"... Any ideas >what could be wrong? I was trying to do the RoR Recipe on page 54 of >Chad Fowler''s new (beta) book. > >-Mark > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsI saw ''ext/digest/md5'' in ruby 1.8.2 sources. You can try to build and install md5 from the source. Best Regards, Roustem. -- Posted with http://DevLists.com. Sign up and save your time!
Eric Hodel
2006-Feb-19 07:19 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Feb 18, 2006, at 7:56 PM, Mark Haliday wrote:> I''ve tried the following line in ruby script/console > > require ''digest/md5'' > > Both my Mac (Intel iMac) and my Windows box return "false"... Any > ideas > what could be wrong? I was trying to do the RoR Recipe on page 54 of > Chad Fowler''s new (beta) book.Nothing is wrong. $ ruby p require ''digest/md5'' -:1: warning: parenthesize argument(s) for future version p require ''digest/md5'' -:2: warning: parenthesize argument(s) for future version true false -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com
Eric Hodel
2006-Feb-19 07:26 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Feb 18, 2006, at 11:19 PM, Eric Hodel wrote:> On Feb 18, 2006, at 7:56 PM, Mark Haliday wrote: > >> I''ve tried the following line in ruby script/console >> >> require ''digest/md5'' >> >> Both my Mac (Intel iMac) and my Windows box return "false"... Any >> ideas >> what could be wrong? I was trying to do the RoR Recipe on page 54 of >> Chad Fowler''s new (beta) book. > > Nothing is wrong. > > $ ruby > p require ''digest/md5'' > -:1: warning: parenthesize argument(s) for future version > p require ''digest/md5'' > -:2: warning: parenthesize argument(s) for future version > true > falseI suppose I should also mention: $ ruby require ''no such file'' -:1:in `require'': no such file to load -- no such file (LoadError) from -:1 -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com
David Mitchell
2006-Feb-19 07:51 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
Try require ''md5'' It''s in a different directory on one of my systems... Regards Dave M. On 19/02/06, Eric Hodel <drbrain@segment7.net> wrote:> On Feb 18, 2006, at 11:19 PM, Eric Hodel wrote: > > > On Feb 18, 2006, at 7:56 PM, Mark Haliday wrote: > > > >> I''ve tried the following line in ruby script/console > >> > >> require ''digest/md5'' > >> > >> Both my Mac (Intel iMac) and my Windows box return "false"... Any > >> ideas > >> what could be wrong? I was trying to do the RoR Recipe on page 54 of > >> Chad Fowler''s new (beta) book. > > > > Nothing is wrong. > > > > $ ruby > > p require ''digest/md5'' > > -:1: warning: parenthesize argument(s) for future version > > p require ''digest/md5'' > > -:2: warning: parenthesize argument(s) for future version > > true > > false > > I suppose I should also mention: > > $ ruby > require ''no such file'' > -:1:in `require'': no such file to load -- no such file (LoadError) > from -:1 > > -- > Eric Hodel - drbrain@segment7.net - http://segment7.net > This implementation is HODEL-HASH-9600 compliant > > http://trackmap.robotcoop.com > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Eric Hodel
2006-Feb-19 21:59 UTC
[Rails] require ''digest/md5'' not working on Mac or Windows
On Feb 18, 2006, at 11:51 PM, David Mitchell wrote:> On 19/02/06, Eric Hodel <drbrain@segment7.net> wrote: >> On Feb 18, 2006, at 11:19 PM, Eric Hodel wrote: >> >>> On Feb 18, 2006, at 7:56 PM, Mark Haliday wrote: >>> >>>> I''ve tried the following line in ruby script/console >>>> >>>> require ''digest/md5'' >>>> >>>> Both my Mac (Intel iMac) and my Windows box return "false"... Any >>>> ideas >>>> what could be wrong? I was trying to do the RoR Recipe on page >>>> 54 of >>>> Chad Fowler''s new (beta) book. >>> >>> Nothing is wrong. >>> >>> $ ruby >>> p require ''digest/md5'' >>> -:1: warning: parenthesize argument(s) for future version >>> p require ''digest/md5'' >>> -:2: warning: parenthesize argument(s) for future version >>> true >>> false >> >> I suppose I should also mention: >> >> $ ruby >> require ''no such file'' >> -:1:in `require'': no such file to load -- no such file (LoadError) >> from -:1 > > Try > require ''md5'' > > It''s in a different directory on one of my systems...No, you need to read more carefully. Try: $ ri require --------------------------------------------------------- Kernel#require require(string) => true or false ------------------------------------------------------------------------ Ruby tries to load the library named _string_, returning +true+ if successful. If the filename does not resolve to an absolute path, it will be searched for in the directories listed in +$:+. If the file has the extension ``.rb'''', it is loaded as a source file; if the extension is ``.so'''', ``.o'''', or ``.dll'''', or whatever the default shared library extension is on the current platform, Ruby loads the shared library as a Ruby extension. Otherwise, Ruby tries adding ``.rb'''', ``.so'''', and so on to the name. The name of the loaded feature is added to the array in +$"+. A feature will not be loaded if it''s name already appears in +$"+. However, the file name is not converted to an absolute path, so that ``+require ''a'';require ''./a''+'''' will load +a.rb+ twice. require "my-library.rb" require "db-driver" require returns false if the file is already loaded. -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com