{"id":773,"date":"2010-03-18T12:28:51","date_gmt":"2010-03-18T19:28:51","guid":{"rendered":"http:\/\/wp.colliertech.org\/cj\/?p=773"},"modified":"2010-03-19T17:11:07","modified_gmt":"2010-03-20T00:11:07","slug":"ironruby-on-os-x","status":"publish","type":"post","link":"https:\/\/wp.c9h.org\/cj\/?p=773","title":{"rendered":"IronRuby on OS X"},"content":{"rendered":"<p>We had a visitor on #ironruby today asking for help getting IR running on his mac.  I gave him the following directions, and they seemed to work aside from one glitch.  I tested them on my wife&#8217;s mac, and it worked for me, too.<\/p>\n<h3>Install Mono<\/h3>\n<p>You can grab the Mono .dmg from <a href=\"http:\/\/www.go-mono.com\/mono-downloads\/download.html\">go-mono.com<\/a>.  This will install the framework and put the required programs (mono, xbuild) in your PATH.<\/p>\n<h3>Fetch the IronRuby source<\/h3>\n<p>Since <a href=\"http:\/\/blog.jredville.com\/\">Jim Deville<\/a> likes macs, I&#8217;m sure more recent versions will work, but this is the one we&#8217;ve recently packaged up for <a href=\"http:\/\/packages.debian.org\/source\/sid\/dlr-languages\">Debian<\/a> and tested on <a href=\"https:\/\/bugs.launchpad.net\/ubuntu\/+source\/ironpython\/+bug\/525547\">Ubuntu<\/a>.  If you want to be certain that the IronRuby code you write on Debian works on OS X, then you should probably build from the same version of the source.  You should probably also install <a href=\"http:\/\/ftp.novell.com\/pub\/mono\/archive\/2.4.3\/macos-10-universal\/1\/MonoFramework-2.4.3_1.macos10.novell.universal.dmg\">version 2.4.3<\/a> of Mono, but that may be more effort than it&#8217;s worth ;)<\/p>\n<p><a href=\"http:\/\/github.com\/mletterle\/ironruby\/tarball\/20090805+git.e6b28d27\">http:\/\/github.com\/mletterle\/ironruby\/tarball\/20090805+git.e6b28d27<\/a><\/p>\n<h3>Unpack the tarball<\/h3>\n<p>Open up a terminal and unpack the thing you just downloaded:<br \/>\n<\/p>\n<pre>\r\n<b>$<\/b> mkdir ~\/src\/\r\n<b>$<\/b> cd ~\/src\/\r\n<b>$<\/b> tar xfz ~\/Desktop\/mletterle-ironruby-e6b28d2.tar.gz\r\n<b>$<\/b> cd mletterle-ironruby-e6b28d2\/\r\n<\/pre>\n<h3>Build IronRuby<\/h3>\n<p>At this point, you should be able to build the IronRuby assemblies using xbuild.  I don&#8217;t recommend using rake, as it has some dependencies, and I&#8217;m not a fan of dependencies.<br \/>\n<\/p>\n<pre>\r\n<b>$<\/b> xbuild \/p:TreatWarningsAsErrors=false Merlin\/Main\/Languages\/Ruby\/Ruby.sln\r\n&lt;snip\/&gt;\r\nBuild succeeded.\r\n\t 2817 Warning(s)\r\n\t 0 Error(s)\r\n\r\nTime Elapsed 00:00:28.8378230\r\n<\/pre>\n<h3>Run the IronRuby interactive interpreter<\/h3>\n<p>Our guest mentioned that he was using a terminal with a white background.  Do note that the font color of the interactive interpreter (aka Read-Eval-Print Loop or REPL) is white, so if you&#8217;re using a white background, you might want to change it.  IIRC, there is a way to change the font color using a configuration setting.  Figuring it out is left as an exercise for the reader.<br \/>\n<\/p>\n<pre>\r\n<b>$<\/b> mono Merlin\/Main\/Bin\/Debug\/ir.exe\r\nIronRuby 0.9.0.0 on 2.6.3 (tarball Wed Mar 10 18:18:12 MST 2010)\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\n\r\n<b>&gt;&gt;&gt;<\/b> 1+2\r\n=&gt; 3\r\n<b>&gt;&gt;&gt;<\/b> exit()\r\n<\/pre>\n<h3>Extra credit: IronPython<\/h3>\n<p>The tarball you downloaded also included the source to IronPython.  The procedure to build\/run IronPython is pretty similar to IronRuby.<\/p>\n<h3>Build IronPython<\/h3>\n<p>Unlike IronRuby&#8217;s .sln, this version of IronPython&#8217;s .sln does not have a default configuration parameter, so we need to specify it with the \/p:Configuration=Debug argument.<br \/>\n<\/p>\n<pre>\r\n<b>$<\/b> xbuild \/p:TreatWarningsAsErrors=false \/p:Configuration=Debug Merlin\/Main\/Languages\/IronPython\/IronPython.sln\r\n&lt;snip\/&gt;\r\n\t 69 Warning(s)\r\n\t 0 Error(s)\r\n\r\nTime Elapsed 00:00:38.8057450\r\n<\/pre>\n<h3>Run the IronPython interactive interpreter<\/h3>\n<p>IronPython has a REPL interface like IronRuby&#8217;s.  Or is it the other way around?  Anyway, here&#8217;s an example.<br \/>\n<\/p>\n<pre>\r\n<b>$<\/b> mono .\/\/Merlin\/Main\/Bin\/Debug\/ipy.exe    \r\nIronPython 2.6 Beta 2 DEBUG (2.6.0.20) on .NET 2.0.50727.1433\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n<b>&gt;&gt;&gt;<\/b> 1+2\r\n3\r\n<b>&gt;&gt;&gt;<\/b> ^D\r\n<\/pre>\n\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet?via=cjamescollier\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We had a visitor on #ironruby today asking for help getting IR running on his mac. I gave him the following directions, and they seemed to work aside from one glitch. I tested them on my wife&#8217;s mac, and it worked for me, too. Install Mono You can grab the Mono .dmg from go-mono.com. This [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[17,189,79,181,206,194,37,7,15,29,130,210,191],"tags":[],"class_list":["post-773","post","type-post","status-publish","format-standard","hentry","category-debian","category-dlr","category-free-software","category-irc","category-ironpython","category-ironruby","category-microsoft","category-mono","category-novell","category-python","category-ubuntu","category-ubuntu-us-wa","category-xbuild"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1YDIB-ct","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts\/773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=773"}],"version-history":[{"count":12,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions"}],"predecessor-version":[{"id":790,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions\/790"}],"wp:attachment":[{"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.c9h.org\/cj\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}