This post originated from an RSS feed registered with Ruby Buzz
by Christopher Williams.
Original Post: Build your own Ruby 2.0 (with VM)
Feed Title: Late to the Party
Feed URL: http://cwilliams.textdriven.com/xml/rss20/feed.xml
Feed Description: Ruby. Rails. Stuff.
In an effort to try and get more people up and running with YARV/Ruby 2.0, here's a quick and dirty guide for building your own copy to play with. This guide will create a safe yarv-based ruby interpreter that won't blow away or override your normal ruby interpreter.
If you already have an installation of ruby with rubygems installed, please temporarily alter your environment variables and remove the RUBYOPT value. This environment variable allows users to set up scripts that should be loaded by default when a ruby interpreter is launched. When building yarv, it will confuse the newly built interpreter, because the file won't exist in it's libraries/load path yet. For Windows users - to remove the variable go to Control Panel - System, click the advanced tab, click the Environment variables button. In the System Variables section, search for RUBYOPT and delete the entry. Please do not forget to add the entry back in when finished playing with YARV - the value should be 'rubygems'.
Install cygwin
http://www.cygwin.com
For Windows users only, obviously. Run the setup.exe provided to install via the Internet.
Make sure you install these non-default cygwin packages:
devel
autoconf
bison
If you don't have it yet, download a Subversion command line client. You can open a command line (Windows users, that means cygwin) and try out:
which svn
If it can't find the file, you need to get a client.
Open a command line. For windows users, this means a cygwin command line.
You will see errors! That's because YARV isn't finished yet. We're trying to help them test on real live ruby code.
make test-all
You will see errors!
make install
You should now have a ruby/yarv executable in /usr/local/yarv/bin/ruby-yarv(.exe). To test out scripts, just provide the full path to the yarv interpreter when invoking to use YARV.