Install ruby 1.9 on Windows using zip binary
Update: This post is outdated. All in one installer for 1.9
is ready now, you should use it if you need 1.9 on windows. Get it here
http://rubyforge.org/frs/?group_id=167
Ruby has “all-in-one” installer for Windows, but it is outdated. As
of May 2009, Ruby 1.9.1 is released, the installer is still 1.8.6. If
you want the latest version, you need the zip package. But the zip
package is missing zlib.dll, libeay32.dll, ssleay32.dll and readline.dll
. Here is how to install it on windows.
Download the file
First you download the 1.9 package from http://www.ruby-lang.org/en/downloads/
Choose “Ruby 1.9 xxx binary” instead of “Ruby xxx Installer”.
Install it
Just Unpack the zip to c:\ruby.
Then add c:\ruby\bin to windows PATH.
Open a windows command console and type
gem update --system
Oops, it is broken! The binary is missing some dll files.
Let us fix it
zlib
Download zlib windows binary from
http://gnuwin32.sourceforge.net/packages/zlib.htm
unzip the package, then find a file named “zlib1.dll”.
Copy “zlib1.dll” to your ruby\bin directory AND rename it to zlib.dll
What the heck?! Why renaming it? Because ruby source code reference the
dll as zlib.dll. It is common to use alias like this on Linux. Ruby
source was coded on Linux.
openssl
Download openssl windows binary from
http://gnuwin32.sourceforge.net/packages/openssl.htm
Unzip it.
Find “libeay32.dll”, copy to ruby\bin. Don’t rename it.
Find “libssl32.dll”, copy to ruby\bin and rename it to ssleay32.dll
readline
Download readline windows binary from
http://gnuwin32.sourceforge.net/packages/readline.htm
Unzip it.
Find “readline5.dll”, copy to ruby\bin and rename it to readline.dll
Done
That is all. Now type
gem update --system
then
gem install rails
Ïà¹ØÎĵµ£º
require 'curses'
module Curses
def self.program
main_scr=init_screen
noecho
cbreak
curs_set(0)
main_scr.keypad=true
yield main_scr
end
end
Curses.program do |scr|
max_x=scr.maxx
max_y=scr.maxy
100.times do
scr.setpos(rand(max_y),rand(max_x))
......
Ruby ÀàµÄ¼Ì³Ð
¹Ø¼ü×Ö: Ruby ÀàµÄ¼Ì³Ð
Ò»¡¢ÆÕͨ·½Ê½µÄ¼Ì³Ð
RubyÖ»Ö§³Öµ¥¼Ì³Ð
ruby ´úÂë
class
Child < Father
......
end
ObjectÊÇËùÓÐÀàµÄʼ×棬²¢ÇÒObjectµÄʵÀý·½·¨ ......
¿ª·¢»·¾³
Ruby: Ruby1.9.1
Rails: Rails2.3.5
Mysql:Mysql5.0.9
Driver:mysql-2.8.1-x86-mingw32.gem
IDE:Rubymine2.0.1
Ò»¡¢´´½¨Êý¾Ý±íUsers
ÀûÓÃRubyMine×Ô´øµÄScaffold¹¤¾ß´´½¨Êý¾Ý±íUsers£¬Ò²¿ÉÒÔÊÖ¶¯´´½¨
¶þ¡¢´´½¨ControllerºÍView
RubyÏîÄ¿—>ÓÒ¼ü—>Create Model
Íê³Éºó½«×Ô¶¯Éú³ÉÏàÓ¦µÄÎ ......
%{String} ÓÃÓÚ´´½¨Ò»¸öʹÓÃË«ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®
%Q{String} ÓÃÓÚ´´½¨Ò»¸öʹÓÃË«ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®
%Q!Some String of “Characters”! <==> ” Some String of \”Characters\” “
%q{String} ÓÃÓÚ´´½¨Ò»¸öʹÓõ¥ÒýºÅÀ¨ÆðÀ´µÄ×Ö·û´®
%q!Som ......
RuportÖÐpdf_writer¶ÔÖÐÎĵÄÖ§³Ö²¢²»ºÃ£¬Êä³öµÄÖÐÎÄÏÔʾµÄÊÇÂÒÂë¡£ÉÏÍø²éÁ˺ܶà×ÊÁÏ£¬Ò²Ã»ÓÐÕÒµ½ºÃµÄ½â¾ö·½°¸£¬ÎÞÄÎÖ»ºÃ²é¿´Ô´´úÂ룬µ½µ×ΪʲôRuport×Ô´øµÄPDF¹¤¾ß²»Ö§³ÖÖÐÎÄÊä³ö¡£
Ruport::Formatter::PDF::WriterÖÐÕÒµ½ÒÔÏ´úÂë
metrics = load_font_metrics(font)
metrics = PDF::Writer: ......