Gmail ͏°´õ ¹®¼­µµ±¸ ¸®´õ Google °Ë»ö ´õº¸±â »
ÃÖ±Ù ¹æ¹®ÇÑ ±×·ì | µµ¿ò¸» | ·Î±×ÀÎ
Google ±×·ì Ȩ
Cygwin Rails issues "/dev/urandom" not found
ÇöÀç ÀÌ ±×·ì¿¡ ¿ì¼± Ç¥½ÃµÇ´Â ÁÖÁ¦°¡ ³Ê¹« ¸¹½À´Ï´Ù. ÀÌ ÁÖÁ¦°¡ ¿ì¼± Ç¥½ÃµÇµµ·Ï ÇÏ·Á¸é ´Ù¸¥ ÁÖÁ¦¿¡¼­ ¿ì¼±Ç¥½Ã ¿É¼ÇÀ» »èÁ¦Çϼ¼¿ä.
¿äûÀ» ó¸®ÇÏ´Â µµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù. ´Ù½Ã ½ÃµµÇØ ÁֽʽÿÀ.
Ç÷¡±×
  ¸Þ½ÃÁö 3°³ - ¸ðµÎ Á¢±â  -  ¸ðµÎ ·Î ¹ø¿ª ¹ø¿ªµÊ(Àüü ¿ø¹® º¸±â)
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ½Ç ±×·ìÀº À¯Áî³Ý ±×·ìÀÔ´Ï´Ù. ÀÌ ±×·ì¿¡ ¸Þ½ÃÁö¸¦ °Ô½ÃÇϽøé ÀÎÅͳÝÀÇ ¸ðµç »ç¿ëÀÚ°¡ »ç¿ëÀÚÀÇ À̸ÞÀÏÀ» º¼ ¼öµµ ÀÖ½À´Ï´Ù.
´ä±ÛÀÌ Àü¼ÛµÇÁö ¾Ê¾Ò½À´Ï´Ù.
°Ô½ÃµÇ¾ú½À´Ï´Ù.
 
º¸³½»ç¶÷:
¹Þ´Â»ç¶÷:
ÂüÁ¶:
Ãß°¡ ´äº¯:
ÂüÁ¶ Ãß°¡ | Ãß°¡ ´äº¯ Ãß°¡ | Á¦¸ñ ¼öÁ¤
Á¦¸ñ:
È®ÀÎ:
È®ÀÎÀ» À§ÇØ ¾Æ·¡ ±×¸²¿¡ Ç¥½ÃµÈ ¹®ÀÚ¸¦ ÀÔ·ÂÇϰųª ¾×¼¼½º ¾ÆÀÌÄÜÀ» Ŭ¸¯ÇÏ¿© µé¸®´Â ¼ýÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä. ¼ýÀÚ¸¦ µéÀº ÈÄ ÇØ´ç ¼ýÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
 
jjburka  
ÇÁ·ÎÇÊ º¸±â   ·Î ¹ø¿ª ¹ø¿ªµÊ(¿ø¹® º¸±â)
 Ãß°¡ ¿É¼Ç 2007³â12¿ù13ÀÏ, ¿ÀÈÄ12½Ã54ºÐ
º¸³½»ç¶÷: jjburka <jjbu...@gmail.com>
³¯Â¥: Wed, 12 Dec 2007 19:54:32 -0800 (PST)
ÇöÁö½Ã°£: 2007³â12¿ù13ÀÏ(¸ñ) ¿ÀÈÄ12½Ã54ºÐ
Á¦¸ñ: Cygwin Rails issues "/dev/urandom" not found
Hey,

I'm trying to install ruby on rails on windows xp with cygwin. I
installed the rails gem but when I go to create an application I get
the following : "No such file or directory - /dev/urandom"  the error
seems to be coming form secret_key_generator.rb line 22. But I can't
find a file of that name

Thanks


    Àü´Þ  
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ±×·ì¿¡ °¡ÀÔÇØ¾ß ÇÕ´Ï´Ù.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ¸ÕÀú ÇØ´ç ±×·ì¿¡ °¡ÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.
°Ô½ÃÇϱâ Àü¿¡ °¡ÀÔ ¼³Á¤ ÆäÀÌÁö¿¡¼­ ´Ð³×ÀÓÀ» ¾÷µ¥ÀÌÆ®Çϼ¼¿ä.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.
Marcin Jekot  
ÇÁ·ÎÇÊ º¸±â   ·Î ¹ø¿ª ¹ø¿ªµÊ(¿ø¹® º¸±â)
 Ãß°¡ ¿É¼Ç 2007³â12¿ù14ÀÏ, ¿ÀÈÄ11½Ã10ºÐ
º¸³½»ç¶÷: Marcin Jekot <rails-mailing-l...@andreas-s.net>
³¯Â¥: Fri, 14 Dec 2007 15:10:20 +0100
ÇöÁö½Ã°£: 2007³â12¿ù14ÀÏ(±Ý) ¿ÀÈÄ11½Ã10ºÐ
Á¦¸ñ: Re: Cygwin Rails issues "/dev/urandom" not found
Hi,

Apparently the /dev/urandom file does not 'exist' in cygwin, but you can
do stuff with it, i.e. `cat /dev/urandom' (although don't try this, cos
it tends to mess things up a bit).

In any case, things like File.exists?('/dev/urandom')  in
'secret_key_generator.rb' file fail.

So I changed all the occurences of 'if File.exists?('/dev/urandom')' to
'if true'. Still it would fail on: 'File.read("/dev/urandom",
64).unpack("H*")[0]'

Now don't ask me why (it's only my 3rd day with Ruby, and 1st day with
Rails), works for me if I put this line before the File.read() :

    def generate_secret_with_urandom
      puts "Before Read"
      return File.read("/dev/urandom", 64).unpack("H*")[0]
    end

et voila, it works. I don't know why it works (yet), but it does ;), I
now have cygwin + ruby (the cygwin one) + gem + rails working.

I even checked if the "secret" returned is different every time, and it
is. It's an oddity, and I'll have to fix it every time I update to a new
version of Rails, but I'm hoping to be more of an expert by the time an
update is released ;)

-Marcin Jekot

jjburka wrote:
> Hey,

> I'm trying to install ruby on rails on windows xp with cygwin. I
> installed the rails gem but when I go to create an application I get
> the following : "No such file or directory - /dev/urandom"  the error
> seems to be coming form secret_key_generator.rb line 22. But I can't
> find a file of that name

> Thanks

--
Posted via http://www.ruby-forum.com/.

    Àü´Þ  
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ±×·ì¿¡ °¡ÀÔÇØ¾ß ÇÕ´Ï´Ù.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ¸ÕÀú ÇØ´ç ±×·ì¿¡ °¡ÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.
°Ô½ÃÇϱâ Àü¿¡ °¡ÀÔ ¼³Á¤ ÆäÀÌÁö¿¡¼­ ´Ð³×ÀÓÀ» ¾÷µ¥ÀÌÆ®Çϼ¼¿ä.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.
Lenart  
ÇÁ·ÎÇÊ º¸±â   ·Î ¹ø¿ª ¹ø¿ªµÊ(¿ø¹® º¸±â)
 Ãß°¡ ¿É¼Ç 2008³â1¿ù4ÀÏ, ¿ÀÀü1½Ã05ºÐ
º¸³½»ç¶÷: Lenart <lenart.ru...@gmail.com>
³¯Â¥: Thu, 3 Jan 2008 08:05:34 -0800 (PST)
ÇöÁö½Ã°£: 2008³â1¿ù4ÀÏ(±Ý) ¿ÀÀü1½Ã05ºÐ
Á¦¸ñ: Re: Cygwin Rails issues "/dev/urandom" not found
What Marcin said works - I just wanted to simplify the steps:

1. locate the file secret_key_generator.rb inside cygwin directory (in
my case - c:\cygwin\lib\ruby\gems\1.8\gems\rails-2.0.2\lib
\rails_generator\)
2. find "def generate_secret_with_urandom" (line #85 in Rails 2.0.2)
3. copy the line just below "def generate_....":
    puts "Before Read"
4. save the file and it should work

Hope it helps


    Àü´Þ  
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ±×·ì¿¡ °¡ÀÔÇØ¾ß ÇÕ´Ï´Ù.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÏ·Á¸é ¸ÕÀú ÇØ´ç ±×·ì¿¡ °¡ÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.
°Ô½ÃÇϱâ Àü¿¡ °¡ÀÔ ¼³Á¤ ÆäÀÌÁö¿¡¼­ ´Ð³×ÀÓÀ» ¾÷µ¥ÀÌÆ®Çϼ¼¿ä.
¸Þ½ÃÁö¸¦ °Ô½ÃÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ¾ø½À´Ï´Ù.
¸Þ½ÃÁöÀÇ ³¡
« Åä·ÐÀ¸·Î µ¹¾Æ°¡±â « ´ÙÀ½     ÀÌÀü »

±×·ì ¸¸µé±â - Google ±×·ì½º - Google Ȩ - ¼­ºñ½º ¾à°ü - °³ÀÎÁ¤º¸ º¸È£Á¤Ã¥
©2010 Google