¥È¥Ã¥×   ÊÔ½¸ Åà·ë º¹Ê¬ ¥Ð¥Ã¥¯¥¢¥Ã¥× źÉÕ Ê£À½ ̾Á°Êѹ¹ ¥ê¥í¡¼¥É   ¿·µ¬ °ìÍ÷ ñ¸ì¸¡º÷ ºÇ½ª¹¹¿·   ¥Ø¥ë¥×   ºÇ½ª¹¹¿·¤ÎRSS

Ruby

Last-modified: 2018-11-14 (¿å) 15:24:00 (2153d)
Top / Ruby

µ¤¤ò¤Ä¤±¤ëÅÀ

  1. print¤Î°ú¿ô¤ò¥«¥ó¥Þ¤Ç¶èÀÚ¤ë¤È¡¢Ï¢·ë¤·¤Æɽ¼¨¤·¤Þ¤¹¡£
  2. puts¤Î°ú¿ô¤ò¥«¥ó¥Þ¤Ç¶èÀÚ¤ë¤È¡¢²þ¹Ô¤·¤Æɽ¼¨¤·¤Þ¤¹¡£
  3. false, nil¤À¤±¤¬µ¶¤Ç¤¹¡£0¤Ï¿¿¤Ë´Þ¤Þ¤ì¤Þ¤¹¡£
  4. ¡Ö/Àµµ¬É½¸½/ =~ ʸ»úÎó¡×¤È¤¤¤¦¼°¤Ï¡¢Ê¸»úÎó¤ò¸¡º÷¤·¤Æ¡¢Àµµ¬É½¸½¤¬¸«¤Ä¤«¤Ã¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹ÃͤȤʤê¤Þ¤¹¡£¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð¡¢nil¤È¤Ê¤ê¡¢µ¶¤È¤Ê¤ê¤Þ¤¹¡£

FAQ

Aptana¤ËRadRails¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤è¤¦¤È¤·¤Æ¡¢ÅÓÃæ¤Ç403 forbidden¤Èɽ¼¨¤µ¤ì¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¡£
¢ª ¼¡¤Îurl¤òÆþÎϤ·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£

Ruby on Rails 1.2.3¤ËRuby-GetText¤ò¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó¡£

C:\InstantRails\rails_apps>gem install gettext
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find gettext (> 0) in any repository
C:\InstantRails\rails_apps>gem install gettext -v 1.10.0
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    Could not find gettext (= 1.10.0) in any repository

¢ª ¼¡¤Î¤è¤¦¤ËľÀÜ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£

C:\InstantRails\rails_apps>gem install c:\tmp\gettext-1.10.0-mswin32.gem
Successfully installed gettext, version 1.10.0

¢¨1.10.0¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤ÎRuby-GetText¤ÏRuby on Rails2.0°Ê¹ßÂбþ¤Ê¤Î¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤»¤ó
http://underscore.jp/diary/20080227.html

XREA¤Çruby¤ò¼Â¹Ô¤¹¤ëÊýË¡

¥µ¥ó¥×¥ë¤Î¤è¤¦¤Ëµ­½Ò¤·¡¢FTP¥½¥Õ¥È¤Ç¡Ö/public_html/ruby/websample¡×¤Ë¥¢¥Ã¥×¥í¡¼¥É¤·¤Æ¤Þ¤¹¡£¤½¤Î¸å¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò700¤È¤·¤Þ¤¹¡£

UTF-8½ÐÎÏÎã

sample_web_page_utf8.cgi ... ¥¹¥¯¥ê¥×¥È¼«¿È¤âUTF-8¤Çµ­½Ò¤·¤Þ¤¹¡£

#!/usr/local/bin/ruby -Ku
# UTF-8 Web¥Ú¡¼¥¸½ÐÎÏ¥µ¥ó¥×¥ë

print "Content-type: text/html; charset=UTF-8\n\n"
puts "<html>"
puts "<head>"
puts "<meta http-equiv='content-type' content='text/html; charset=UTF-8'>"
puts "</head>"
puts "<body>"
puts "Hello ¥ë¥Ó¡¼!"
puts "</body>"
puts "</html>"

¼¡¤Îurl¤Ç¥Ú¡¼¥¸¤ò³Îǧ¤Ç¤­¤Þ¤¹¡£
http://tadaa.jp/ruby/websample/sample_web_page_utf8.cgi

Shift_JIS½ÐÎÏÎã

sample_web_page_sjis.cgi ... ¥¹¥¯¥ê¥×¥È¼«¿È¤âShift_JIS¤Çµ­½Ò¤·¤Þ¤¹¡£

#!/usr/local/bin/ruby -Ks
# Shift-JIS Web¥Ú¡¼¥¸½ÐÎÏ¥µ¥ó¥×¥ë

print "Content-type: text/html; charset=Shift_JIS\n\n"
puts "<html>"
puts "<head>"
puts "<meta http-equiv='content-type' content='text/html; charset=Shift_JIS'>"
puts "</head>"
puts "<body>"
puts "Hello ¥ë¥Ó¡¼!"
puts "</body>"
puts "</html>"

¼¡¤Îurl¤Ç¥Ú¡¼¥¸¤ò³Îǧ¤Ç¤­¤Þ¤¹¡£
http://tadaa.jp/ruby/websample/sample_web_page_sjis.cgi

Ãí°ÕÅÀ

¥¢¥Ã¥×¾ì½ê¤Ïruby¥Õ¥©¥ë¥À¤Ç¤Ê¤¯¤Æ¤â£Ï£Ë¤Ç¤¹¡£
»²¹Íurl:XREA TroubleShooter

¥ê¥ó¥¯