<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>haslo.ch - Guido's Blog &#187; ruby</title>
	<atom:link href="http://www.haslo.ch/blog/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haslo.ch/blog</link>
	<description>We believe that people with passion can change the world for the better.</description>
	<lastBuildDate>Wed, 16 Nov 2011 11:23:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Getting MySQL 5.0 to work in Ruby 1.9.1 on Windows 7</title>
		<link>http://www.haslo.ch/blog/getting-mysql-5-0-to-work-in-ruby-1-9-1-on-windows-7/</link>
		<comments>http://www.haslo.ch/blog/getting-mysql-5-0-to-work-in-ruby-1-9-1-on-windows-7/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 00:15:59 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=2768</guid>
		<description><![CDATA[So, I got MySQL to work for my Ruby on Rails development environment. Let&#8217;s be clear about what I actually wanted: Ruby 1.9.1 Rails 2.3.2 Any version of MySQL whatsoever Any way whatsoever to make my up-to-date Ruby on Rails talk to that MySQL I don&#8217;t care what version of MySQL. I don&#8217;t care if [...]]]></description>
			<content:encoded><![CDATA[<p>So, I got MySQL to work for my Ruby on Rails development environment. Let&#8217;s be clear about what I actually wanted:</p>
<ul>
<li>Ruby 1.9.1</li>
<li>Rails 2.3.2</li>
<li>Any version of MySQL whatsoever</li>
<li>Any way whatsoever to make my up-to-date Ruby on Rails talk to that MySQL</li>
</ul>
<p>I don&#8217;t care what version of MySQL. I don&#8217;t care if I have to force platforms for Gems or recompile or whatever. I never did care, and I&#8217;ll happily even dig through code to make manual changes before compiling or what-have-you. What I do care about is actually getting this to work, so I can finally stop tinkering and start doing something productive.</p>
<p>Well, I learned a lot on my way there. I had a glimpse at <a href="http://www.linuxtopia.org/online_books/programming_books/ruby_tutorial/Extending_Ruby_Creating_a_Makefile_with_extconf.rb.html">how extconf.rb works</a> (because I had to figure out correct parameters), I dug through rails sources to find errors that you don&#8217;t even want to know about, had another good look at <a href="http://www.gnu.org/software/make/">makefiles</a>, and generally tried to understand what exactly didn&#8217;t work.</p>
<p>Also, there is a more efficient way to do this, as <a href="http://www.haslo.ch/blog/getting-mysql-5-0-to-work-in-ruby-1-9-1-on-windows-7/#comment-1134">pointed out by Luis in the comments</a>. Thanks!</p>
<h2>So, in the end, it now works</h2>
<p>This <a href="http://blog.xajler.net/?p=14">tutorial blog post on Code Elite</a> was very, very helpful. So were Luis comments <a href="http://www.haslo.ch/blog/actually-installing-ruby-on-rails-on-windows-7/#comments">here</a> and <a href="http://blog.mmediasys.com/2009/06/23/rubyinstaller-get-ready-to-vote/#comments">else</a>w<a href="http://blog.mmediasys.com/2008/08/10/rubygems-with-power-comes-responsibility/#comments">here</a> (although me being quite the newbie when it comes to gcc and the likes, they went a bit over my head).</p>
<p>The Code Elite post is not the best at being copy-paste-able though, the formatting kinda ruins that. It does point out the correct steps to getting MySQL to work in Ruby (and consequently, Rails).</p>
<p>Long story short, these are the steps that lead to a working MySQL integration:<br />
<span id="more-2768"></span></p>
<ol>
<li>Download Ruby 1.9.1 MinGW32 and the corresponding developer kit from the <a href="http://rubyinstaller.org/downloads/">RubyInstaller download page</a>. I prefer the zipped version to the one with installer, to be honest, but that&#8217;s just me.</li>
<li>Get the 32-bit version (not 64-bit, or linking won&#8217;t work) of MySQL 5.0 (not 5.1, or nothing will work) from <a href="http://dev.mysql.com/downloads/mysql/5.0.html#win32">the MySQL download page</a>. Again, I prefer the zipped version.</li>
<li>Get the current mysql-ruby source (2.8.1, currently) <a href="http://tmtm.org/downloads/mysql/ruby/">from its FTP</a>.</li>
<li>Put Ruby into <strong>F:\Ruby</strong> or your path of preference. Add Ruby&#8217;s <strong>\bin</strong> path to <a href="http://www.computerhope.com/issues/ch000549.htm">your path variable</a>. Close and re-open the command window to update the path.</li>
<li>Install Rails &#8211; this is easy.

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

</li>
<li>Put MySQL into <strong>F:\mysql</strong> (or your path, again). No adding to the path yet here.</li>
<li>Put the contents of the mysql-ruby package into your Ruby path (I didn&#8217;t try other paths) and point your command line there, then run this:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby extconf.rb <span style="color: #660033;">--with-mysql-lib</span>=f:<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>opt <span style="color: #660033;">--with-mysql-include</span>=f:<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>include</pre></div></div>

</li>
<li>Run <strong>make</strong>, then <strong>make install</strong>. Here is where 64-bit MySQL fails.</li>
<li>Add the following to your path variable (substituting your MySQL location): <strong>F:\mysql\lib\opt;F:\mysql\bin</strong>. Again, close and re-open the command window to update the path.</li>
<li>Run this to let Ruby <a href="http://www.youtube.com/watch?v=EmEPXXJ4sKw">know MySQL</a>:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'require &quot;mysql&quot;'</span></pre></div></div>

</li>
<li>Get into a command prompt as admin (you might have to right-click a command prompt and &#8220;run as admin&#8221; to get to this) to install and start the MySQL service. To do that, run these in the mysql\bin directory:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqld-nt <span style="color: #660033;">--install</span>
net start mysql</pre></div></div>

</li>
<li>Now that the MySQL server is actually running, you can connect to it to change your root password:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysqladmin <span style="color: #660033;">-u</span> root password topsecretpassword</pre></div></div>

</li>
</ol>
<p>Steps 1-3 are just downloads. Steps 4 and 5 already installs Ruby on Rails completely. Steps 6-12 then are for installing mysql (which is necessary first for the DLLs to be available to the compiler later) and then compiling the mysql-ruby package (driver?) from scratch into Ruby.</p>
<p>Interestingly, step 7 builds the makefile through Ruby (mostly, with some automated C mixed in), while step 8 actually compiles the C source through make and step 10 plugs this into Ruby. Steps 11 and 12 merely configure the MySQL server.</p>
<p>This should be it. And this time, I hope I did no forbidden or ugly things <img src='http://www.haslo.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="Getting MySQL 5.0 to work in Ruby 1.9.1 on Windows 7" />  <span>For they know not what they do and stuff.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/getting-mysql-5-0-to-work-in-ruby-1-9-1-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Actually Installing Ruby on Rails, on Windows 7</title>
		<link>http://www.haslo.ch/blog/actually-installing-ruby-on-rails-on-windows-7/</link>
		<comments>http://www.haslo.ch/blog/actually-installing-ruby-on-rails-on-windows-7/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:32:10 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=2703</guid>
		<description><![CDATA[OK, so I found out what it is that I have to install for my wonderful Ruby on Rails environment. It&#8217;s time to start installing. Keep in mind that much of what I&#8217;m doing here is an experiment (and thanks Luis for being so patient with me). I don&#8217;t claim to know what works and [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so<a href="http://www.haslo.ch/blog/assessing-installing-ruby-on-rails-on-windows-7/"> I found out what it is that I have to install</a> for my wonderful Ruby on Rails environment. It&#8217;s time to start installing.</p>
<p>Keep in mind that much of what I&#8217;m doing here is an experiment (and thanks Luis for being so patient with me). I don&#8217;t claim to know what works and what doesn&#8217;t, I&#8217;m just trying to find my way around here. Follow my steps at your own risk &#8211; they seem to lead to a working environment for now.</p>
<p><strong>Update 2009-07-03 02:16:</strong> <a href="http://www.haslo.ch/blog/getting-mysql-5-0-to-work-in-ruby-1-9-1-on-windows-7/">There&#8217;s a followup post now</a> that does less evil and wrong things, hopefully. It also happens to result in a working Ruby on Rails plus MySQL environment, something this post doesn&#8217;t quite achieve.</p>
<h2>Getting Ruby to run</h2>
<p>Admittedly, I was a little surprised by how easy this was. <a href="http://rubyinstaller.org/downloads/">Get Ruby and the Development kit from here</a>. Extract them (using <a href="http://www.7-zip.org/">7-Zip</a>, which you should use by default anyway), and put all the contained directories where you want your Ruby. Mine resides in <strong>F:\Ruby</strong>.</p>
<p>Next, add the newly installed bin directory to your path. Quickest way: Open the control panel, search for &#8220;environment&#8221;, then click &#8220;edit the system environment variables&#8221;, and add the bin after a semicolon to the &#8220;Path&#8221; variable. Then, change the path in <em>devkit/msys/1.0.11/etc/fstab</em> to where you put your stuff &#8211; you won&#8217;t have to do this if you put Ruby into <strong>C:\Ruby</strong>.</p>
<p>This is what we get:</p>
<div id="attachment_2704" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Ruby_Installed.jpg"><img class="size-medium wp-image-2704 " title="Ruby Installed" src="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Ruby_Installed-300x166.jpg" alt="Ruby Installed" width="300" height="166" /></a><p class="wp-caption-text">Ruby Installed</p></div>
<p>Yay. That was easy. And the greatest thing is that the One-Click installer (even if it&#8217;s not entirely one-click, currently) also already adds support for Ruby Gems.<br />
<span id="more-2703"></span></p>
<h2>Getting Rails</h2>
<p>The next step is to install some gems. There is <a href="http://akitaonrails.com/2009/1/13/the-best-environment-for-rails-on-windows">a long list on Akita on Rails</a>, but after realizing how little stuff works with Ruby 1.9.1 and Windows 7, I chose to (nearly) only install the things I need:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

<p>This installs Rails and the gems it depends on.</p>
<h2>ImageMagick, and Some More Stuff</h2>
<p>Next, since I planned to do so and not out of some technical necessity, we install ImageMagick for Windows &#8211; get the newest <a href="http://rubyforge.org/frs/?group_id=12&amp;release_id=35951">Win32 Binary Gem version from RubyForge</a> and extract it somewhere. Install the gem by going into the directory it&#8217;s extracted into and then executing this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick-2.10.0-x86-mswin32.gem</pre></div></div>

<p>Substitute the gem name with the version you&#8217;re actually using. Then install ImageMagick itself, with the .exe that you just extracted as well.</p>
<p>If you&#8217;re like me, you won&#8217;t be able to resist attempting to install some more gems. <a href="http://www.railsenvy.com/2009/5/6/railsconf-2009-tuesday">Here&#8217;s a nice video with some suggestions</a> from Railsconf 2009. Personally, I installed googlecharts, twitter, cucumber and pdf-writer, but haven&#8217;t gotten to try them out properly yet.</p>
<h2>Testing What We Have</h2>
<p>We have Ruby on Rails now. Yep, that&#8217;s it. Rather painless so far, eh? Test it by going to the directory you want your projects in and typing this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rails testproject</pre></div></div>

<p>You&#8217;ll see Rails creating plenty of directories and files now. After it&#8217;s done, do this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> testproject
ruby script<span style="color: #000000; font-weight: bold;">/</span>server</pre></div></div>

<p>Point your web browser to <em>http://127.0.0.1:3000/</em>, and you should see Rails, in all its glory:</p>
<div id="attachment_2720" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Rails_Installed.jpg"><img class="size-medium wp-image-2720 " title="Rails Installed" src="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Rails_Installed-300x233.jpg" alt="Rails Installed" width="300" height="233" /></a><p class="wp-caption-text">Rails Installed</p></div>
<h2>Not Installing MySQL</h2>
<p>I started out by attempting to install <a href="http://www.mysql.com/">MySQL 5.1</a>, thinking it was stable and all. However, as it turns out, there are plenty of problems with that, and none of them stem from MySQL:</p>
<ul>
<li>The mysql gem relies on libmySQL.dll, which has to be in the path.</li>
<li>The mysql gem is precompiled, there is no 64-bit Windows version, and the 32-bit version relies on msvcrt-ruby18.dll, rather than the newer msvcrt-ruby191.dll.</li>
<li>There is a segmentation fault that I haven&#8217;t found the cause of.</li>
</ul>
<p>I was able to fix the first two problems by adding the mysql/bin directory to the path, and installing a Ruby 1.8.6 alongside the Ruby 1.9.1 to get the 1.8 DLL &#8211; but nevertheless, I never got rid of that segmentation fault, despite multiple reinstalls and even trying MySQL 5.0 instead of 5.1 (<a href="http://www.google.ch/search?q=mysql-2.7.3-x86-mswin32%2Fext%2Fmysql.so%3A+[BUG]+Segmentation+fault">Google search for the exact cause</a>, none of the proposed solutions helped).</p>
<p>(Do not install the 1.8 DLL, that&#8217;s apparently very evil.)</p>
<p>Nothing worked until I gave it a try with Ruby 1.8.6 (after all, I had that installed from attempting to get that DLL, and only needed to change the path variable and install the rails gem to have a go), and lo and behold everything worked fine.</p>
<p>Which convinced me <strong><em>not</em></strong> that I should use Ruby 1.8.6, there&#8217;s too many shiny new features in 1.9.1. Instead, it convinced me that I should forget about MySQL.</p>
<h2>Installing PostgreSQL</h2>
<p>Since <a href="http://www.oracle.com/technology/pub/articles/kern-rails-migrations.html">Rails migrations</a> make database dependencies a thing of the past (or at least, to a very, very large extent), I decided to install PostgreSQL instead. Their <a href="http://www.postgresql.org/download/windows">one-click Windows installer for PostgreSQL 8.3</a> worked a treat and installed the service and everything just fine. Next step, have Rails be able to talk to it &#8211; there are two PostgreSQL gems, only one of which (postgres-pr, <strong><em>not</em></strong> ruby-postgres) currently seems to work in Windows. So let&#8217;s get it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> postgres-pr <span style="color: #660033;">--platform</span>=mswin32</pre></div></div>

<div id="attachment_2746" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Create_Role.jpg"><img class="size-thumbnail wp-image-2746 " title="Create Role" src="http://www.haslo.ch/blog/wp-content/uploads/2009/06/Create_Role-150x150.jpg" alt="Create Role 150x150 Actually Installing Ruby on Rails, on Windows 7" width="150" height="150" /></a><p class="wp-caption-text">Create Role</p></div>
<p>(Not sure if the platform is necessary, but it can&#8217;t hurt.)</p>
<p>Set up a database user (&#8220;login role&#8221; in PostreSQL-speak) with pgAdmin &#8211; I called mine rails &#8211; and give it a password and the ability to create databases.</p>
<p>Now we change the <em>database.yml</em> in the project&#8217;s <em>/config/</em> directory. Open it with some text editor (I like <a href="http://www.editplus.com/">EditPlus</a> myself) and change it to fit your configuration.</p>
<p>This is the <em>database.yml</em> that makes my test project fly:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">development:
 adapter: postgresql
 database: testproject
 username: rails
 password: ***
 pool: <span style="">5</span>
 timeout: <span style="">5000</span>
 host: localhost</pre></div></div>

<p>Note that host:localhost (or the equivalent for your database) is important, as otherwise Rails will attempt to connect to PostgreSQL using <a href="http://en.wikipedia.org/wiki/Unix_domain_socket">UNIX Sockets</a> &#8211; which obviously wouldn&#8217;t work. After that, let&#8217;s test. Go to your shiny rails project in a command window, and type or paste these:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby script<span style="color: #000000; font-weight: bold;">/</span>generate scaffold <span style="color: #7a0874; font-weight: bold;">test</span> title:string description:text
rake db:create
rake db:migrate
ruby script<span style="color: #000000; font-weight: bold;">/</span>server</pre></div></div>

<p>After that, point your browser to <em>http://127.0.0.1:3000/tests/</em> and poke around a bit. You should have your first Rails app running, including all four <a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD</a> actions.</p>
<div id="attachment_2733" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2009/06/CRUD_Running.jpg"><img class="size-medium wp-image-2733 " title="CRUD Running" src="http://www.haslo.ch/blog/wp-content/uploads/2009/06/CRUD_Running-300x199.jpg" alt="CRUD Running" width="300" height="199" /></a><p class="wp-caption-text">CRUD Running</p></div>
<h2>I Think I&#8217;m Done Here</h2>
<p>Done after installing aforementioned <a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug</a> (just click &#8220;install&#8221;), <a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer</a> (yep, &#8220;install&#8221;) and <a href="http://git-scm.com/">Git</a> for msys <a href="http://code.google.com/p/msysgit/downloads/list">from Google Code</a> (which seems to work fine so far). There&#8217;s a Ruby gem for Git, too; install with this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> git</pre></div></div>

<p>I then also got <a href="http://www.vim.org/download.php#pc">gVim 7.3</a> &#8211; not for the faint-hearted, I do have some experience with vim from coding Python on Linux though. I will also test how well editing works with my <a href="http://www.editplus.com/">EditPlus</a>, and probably some IDEs. Either way, I&#8217;ll probably make a little personal user interface evaluation post later on.</p>
<p>Looking back to <a href="http://www.haslo.ch/blog/assessing-installing-ruby-on-rails-on-windows-7/">the assessment post</a>, I&#8217;m actually not done at all. The following things are still missing &#8211; most of them, for a reason:</p>
<ul>
<li>ruby-debug <a href="http://rubyforge.org/tracker/index.php?func=detail&amp;aid=26292&amp;group_id=1900&amp;atid=7439">doesn&#8217;t work with Ruby 1.9.x yet</a>, so that falls flat. It&#8217;s merely a wrapper for the built-in debugger though, so I will be able to debug anyway.</li>
<li><a href="http://mongrel.rubyforge.org/">Mongrel</a> has &#8220;ruby script/server&#8221; produce another segmentation fault, and I don&#8217;t want to spend another 7 hours for not finding a solution to it.</li>
<li><a href="http://httpd.apache.org/">Apache</a> doesn&#8217;t make much sense in a pure development environment, particularly not if we don&#8217;t have Mongrel anyway.</li>
<li><a href="http://subversion.tigris.org/getting.html#windows">Subversion has plenty of versions on their download page</a>. I downloaded <a href="http://www.sliksvn.com/en/download">the one from Slik SVN</a> myself, but haven&#8217;t installed it yet until I actually need it. So that&#8217;s technically missing, too.</li>
</ul>
<h2>Where To Go Now</h2>
<p>There are some resources that can get you started with your most splendid new Ruby on Rails environment. If you have no idea what Rails is yet or why you should use it, have a look at <a href="http://www.railsenvy.com/2007/3/22/ruby-on-rails-video-presentation">this presentation</a>. I found the <a href="http://oreilly.com/catalog/9780596515775/">Head First Rails</a> book to be a very good introduction, too. Concerning Ruby, <a href="http://poignantguide.net/ruby/">Why&#8217;s (Poignant) Guide to Ruby</a> (available <a href="http://poignantguide.net/ruby/whys-poignant-guide-to-ruby.pdf">as pdf</a>, too) is both free <em>and</em> great, albeit talking about Ruby 1.8.2, a tiny bit outdated. If you like it thorough, get the book only known as <a href="http://www.pragprog.com/titles/ruby3/programming-ruby-1-9">the Pickaxe</a>. It is as good as they say.</p>
<p>Thanks for listening, and I hope I can help one or two among you out. You like it? You hate it? You found something I didn&#8217;t? Let me and all your fellow readers know in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/actually-installing-ruby-on-rails-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Assessing Installing Ruby on Rails, on Windows 7</title>
		<link>http://www.haslo.ch/blog/assessing-installing-ruby-on-rails-on-windows-7/</link>
		<comments>http://www.haslo.ch/blog/assessing-installing-ruby-on-rails-on-windows-7/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 12:48:45 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=2675</guid>
		<description><![CDATA[So I wanted to get up and running with a development system for Ruby on Rails, on my shiny freshly installed Windows 7 machine (so, no development stuff on it as of yet whatsoever). However, the recent Ruby update to 1.9.1 brought such big changes that apparently, many libraries don&#8217;t work with it anymore &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>So I wanted to get up and running with a development system for Ruby on Rails, on my shiny freshly installed Windows 7 machine (so, no development stuff on it as of yet whatsoever). However, the recent Ruby update to 1.9.1 brought such big changes that apparently, many libraries don&#8217;t work with it anymore &#8211; so the installer of choice, the <a href="http://rubyforge.org/projects/rubyinstaller/">One-Click Ruby Installer</a>, is (for now) stuck at supporting Ruby 1.8.6 only.</p>
<p><strong>Update 2009-06-23 15:12:</strong> There seems to be <a href="http://github.com/oneclick/rubyinstaller/tree/master">a way to make the one-click installer build Ruby 1.9.1</a>, guess I&#8217;ll have to try that out.</p>
<p>The <a href="http://rubyforge.org/forum/forum.php?forum_id=33233">One-Click Ruby Installer is not dead</a>, and there&#8217;s even a <a href="http://blog.mmediasys.com/2009/06/23/rubyinstaller-get-ready-to-vote/">design vote for the 1.9.1 website</a>. But since I want my development environment bleeding edge and I want it now, I&#8217;ll just have to make do with a manual install. Since I haven&#8217;t found a tutorial detailing the steps for that, I&#8217;ll just do it from scratch and take you along the ride. Good tutorials I did find are:</p>
<ul>
<li><a href="http://akitaonrails.com/2009/1/13/the-best-environment-for-rails-on-windows">The Best Environment for Rails on Windows</a>, including a rant against IDEs</li>
<li><a href="http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/">Installing Rails on Windows</a>, including a guide for setting up MySQL</li>
<li><a href="http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/">Time For A Grown-Up Server</a>, for adding Mongrel and Apache</li>
</ul>
<p>So, what do we need, for a full-blown environment?</p>
<ul>
<li><a href="http://www.ruby-lang.org/en/">Ruby 1.9.1</a> &#8211; obviously, can&#8217;t have Ruby without Ruby</li>
<li><a href="http://docs.rubygems.org/">Ruby Gems 1.3.4</a> &#8211; since gems are the Ruby way of distributing anything</li>
<li><a href="http://rubyonrails.org/">Rails 2.3</a> &#8211; obviously, can&#8217;t have Ruby on Rails without Rails</li>
<li><a href="http://www.mysql.com/">MySQL 5.1</a> &#8211; the database we&#8217;ll use, although others would work as well</li>
<li><a href="http://mongrel.rubyforge.org/">Mongrel 1.1.5</a> &#8211; reliable and secure webserver</li>
</ul>
<p>That&#8217;s it for the start, but for additional tool goodness (and in order to have some of the above run properly in the first place) we need more:</p>
<ul>
<li><a href="http://git-scm.com/">Git 1.6.3.3</a> &#8211; the version control used by rubyists</li>
<li><a href="http://subversion.tigris.org/">Subversion 1.6.3</a> &#8211; very widespread version control (and I refuse to add CVS to this list)</li>
<li><a href="http://www.mingw.org/wiki/MinGW">MinGW</a> and <a href="http://www.mingw.org/wiki/MSYS">MSYS</a> &#8211; to make sure gems can be installed and compiled if necessary</li>
<li><a href="http://rake.rubyforge.org/">Rake 0.8.3</a> &#8211; the ruby version of make</li>
<li><a href="http://rubyforge.org/projects/ruby-debug/">Ruby-Debug 0.10.3</a> &#8211; who doesn&#8217;t like debuggers</li>
<li><a href="http://www.imagemagick.org/">ImageMagick 6.5.3</a> &#8211; can be used by Rails</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">Firebug 1.4.0b2</a> &#8211; for debugging web apps&#8217; JavaScript code (requires the <a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox 3.5 beta</a>)</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer 1.1.6</a> &#8211; for CSS and HTML stuff</li>
<li><a href="http://sourceforge.net/projects/mysqlcc/">MySQL Control Center 0.9.4</a> &#8211; or an alternative that can admin MySQL databases</li>
<li><a href="http://httpd.apache.org/">Apache 2.2.11</a> &#8211; front-end webserver for load balancing and whatnot</li>
</ul>
<p>An intimidating list at first sight, but I did try to get everything I might need in there. The hard part then will be making all of them talk together. Concerning the actual development environment, I am as of yet undecided between <a href="http://www.vim.org/download.php">gVim</a> and an IDE like <a href="http://www.aptana.com/">Aptana</a> or <a href="http://www.jetbrains.com/ruby/">RubyMine</a>. Both have upsides and downsides.</p>
<p>So, is this list complete, do you see anything I&#8217;ve missed? Or do I have anything on it that you think is irrelevant? Let me know in the comments!</p>
<p>So much for talking the talk &#8211; the next step will be walking the walk, and I&#8217;ll make sure to give you a full tutorial afterwards.</p>
<p>Update 2009-06-24 16:05: Yep, Ruby on Rails is installed. <a href="http://www.haslo.ch/blog/actually-installing-ruby-on-rails-on-windows-7/">Here is how I did it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/assessing-installing-ruby-on-rails-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Stack Overflow: Solutions for Coders</title>
		<link>http://www.haslo.ch/blog/stack-overflow-solutions-for-coders/</link>
		<comments>http://www.haslo.ch/blog/stack-overflow-solutions-for-coders/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 12:56:35 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[bubble 2.0]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=1225</guid>
		<description><![CDATA[If you&#8217;re a programmer, you know the problem of solution googlability. It&#8217;s particularly prominent in mainstream languages (and one of the things I decried in my What&#8217;s Wrong with VBA series, as VBA is particularly bad in that respect); you have a problem, you google for it, unless you&#8217;re coding in a good awesome well-designed [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1252" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2008/09/stack_overflow.jpg"><img class="size-thumbnail wp-image-1252" title="Stack Overflow in Firefox 3" src="http://www.haslo.ch/blog/wp-content/uploads/2008/09/stack_overflow-150x150.jpg" alt="Stack Overflow" width="150" height="150" /></a><p class="wp-caption-text">Stack Overflow</p></div>
<p>If you&#8217;re a programmer, you know the problem of solution googlability. It&#8217;s particularly prominent in mainstream languages (and one of the things <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/#community">I decried</a> in my <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">What&#8217;s Wrong with VBA series</a>, as VBA is particularly bad in that respect); you have a problem, you google for it, unless you&#8217;re coding in a <span style="text-decoration: line-through;">good</span> <span style="text-decoration: line-through;">awesome</span> <span style="text-decoration: line-through;">well-designed</span> freak language like Ruby, Python, or Haskell, all you get back is trash and spam.</p>
<p>So, since you&#8217;re reading blogs and a programmer (or you&#8217;d have stopped reading by now, I guess), you know <a href="http://www.joelonsoftware.com/">Joel on Software</a>. Now this guy and his team have done something: They took the Wiki approach of &#8220;everybody can edit&#8221;, added Digg&#8217;s &#8220;let&#8217;s vote stuff up&#8221;, and made the whole thing a generic programming Q&amp;A site.</p>
<p style="text-align: center;"><strong>Behold, and witness, the rise of</strong> <a href="http://stackoverflow.com/"><strong>Stack Overflow</strong></a>.</p>
<p>From <a href="http://www.joelonsoftware.com/items/2008/09/15.html">his launch post</a>:</p>
<blockquote><p>Here’s how it’s supposed to work. This is a community project, so I’m being careful to avoid saying this is how it will work… that’s up to the community. But this is roughly what I have in mind.</p>
<p>Every question in Stack Overflow is like the Wikipedia article for some extremely narrow, specific programming question. <em>How do I enlarge a fizzbar without overwriting the user’s snibbit?</em> [...]</p>
<p>Some people propose answers. Others vote on those answers. If you see the right answer, vote it up. If an answer is obviously wrong (or inferior in some way), you vote it down. Very quickly, the best answers bubble to the top. The person who asked the question in the first place also has the ability to designate one answer as the “accepted” answer, but this isn’t required. The accepted answer floats above all the other answers.</p></blockquote>
<p>Sounds great! It has tags, it&#8217;s not restricted to one programming language, it could provide the framework for thousands of programmers collaborating. And the best thing: They plan to &#8220;keep it ad-free and open to the public forever&#8221;.</p>
<p>You&#8217;ll need an <a href="http://en.wikipedia.org/wiki/Openid">OpenID</a> to log in &#8211; I got one <a href="https://www.myopenid.com/">at myOpenID</a> myself. Too bad it&#8217;s not possible to log in without, but whatever &#8211; I guess this approach has more promise than the closed one that Microsoft tried to force upon us with that whole <a href="http://en.wikipedia.org/wiki/Windows_Live_ID">Live ID</a> crap, but still shares the same weaknesses (which are, mainly, another party involved and a central point of failure).</p>
<p>Nevertheless, I do think this could be awesome. Let&#8217;s see where it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/stack-overflow-solutions-for-coders/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

