<?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>Zen and the Art of Programming &#187; Ruby on Rails</title>
	<atom:link href="http://programmingzen.com/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingzen.com</link>
	<description>Meditations on programming, startups, and technology</description>
	<lastBuildDate>Mon, 16 Jan 2012 17:09:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Speeding up queries by a factor of 100 or more with DB2 Text Search</title>
		<link>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/</link>
		<comments>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 17:11:42 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1397</guid>
		<description><![CDATA[During a recent Rails project at IBM we had to deal with a large table consisting of customers. The table is made up of legacy enterprise data, and contains close to a million records. Among many other fields, the table Customers includes a column name defined as VARCHAR. name is used to store company names. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>
	During a recent Rails project at IBM we had to deal with a large table consisting of customers. The table is made up of legacy enterprise data, and contains close to a million records.
</p>
<p>
	Among many other fields, the table <code>Customers</code> includes a column <code>name</code> defined as <code>VARCHAR</code>. <code>name</code> is used to store company names.
</p>
<p>
	One of the requirements for the project was to implement a Google Suggest-like feature. That is, when the user enters a few characters for the customer&#8217;s name, they should be prompted, via AJAX, with a list of possible suggestions containing that string (or at least beginning with that string.)
</p>
<p>
	The naive approach would be to use a simple <code>LIKE</code> predicate, to generate queries such as:
</p>
<div class="highlight">
<pre><span class="k">SELECT</span> <span class="n">name</span>
<span class="k">FROM</span>   <span class="n">Customers</span>
<span class="k">WHERE</span>  <span class="n">name</span> <span class="k">LIKE</span> <span class="s1">&#39;%micro%&#39;</span>
<span class="k">ORDER</span>  <span class="k">BY</span> <span class="n">name</span>
</pre>
</div>
<p>
	One of the main problems with this approach is performance. Using <code>LIKE</code> this way doesn&#8217;t allow us to take advantage of indexes that are defined on the column <code>name</code>.
</p>
<p>
	Unsurprisingly, on a modest server, such a query takes about 25 seconds. A UI that isn&#8217;t able to respond for 25 seconds will feel like an eternity for the end user, of course, so a simple query like this obviously cannot be seen as a viable solution.
</p>
<p>
	Enter DB2 Text Search. You may be familiar with other full text search engines such as Ferret, Lucene, or Sphinx. <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 V9.7.4</a> ships with an extremely powerful full text search engine that has plenty of useful features, including excellent integration with native XML columns.
</p>
<p>
	Using the <a href="http://db2express.com/download/?S_TACT=ACDB201">free edition of DB2</a> (DB2 Express-C) which includes Text Search, we were able to implement the autocomplete functionality we were after in a heartbeat, thanks to a query like the following:
</p>
<div class="highlight">
<pre><span class="k">SELECT</span> <span class="n">name</span>
<span class="k">FROM</span>   <span class="n">Customers</span>
<span class="k">WHERE</span>  <span class="k">CONTAINS</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s1">&#39;micro&#39;</span><span class="p">)</span> <span class="o">=</span> <span class="mi">1</span>
<span class="k">ORDER</span>  <span class="k">BY</span> <span class="n">name</span>
</pre>
</div>
<p>
	This query was executed in mere fractions of a second for most searches, and behaved exactly as needed. In fact, not only did we match strings that began with the searched token, but also ones that contained it elsewhere (e.g., <code>micro</code> would match both <code>Microsoft</code> and <code>Sun Microsystems</code>.) The results where ordered alphabetically, but could have easily been ordered by relevance via the <code>SCORE</code> function, also available via DB2 Text Search.
</p>
<p>
	As usual, it&#8217;s a matter of using the right tool for the right job, and DB2 Text Search was created exactly for these kind of scenarios.</p>
<p>
	Let&#8217;s briefly look at how you can also go about setting up and playing with it on Linux.
</p>
<h3>Installing DB2 Text Search</h3>
<p>
	To start with, you&#8217;ll need to have a 64bit Linux distro, and then follow these simple steps.
</p>
<p>
	Download <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a>. Make sure you grab the <code>db2exc_974_LNX_x86_64.tar.gz</code> file and not the Light edition.
</p>
<p>
	Next, install DB2 by following <a href="http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/">these steps</a> (the <em>Installing DB2</em> section in particular.) Make sure you select a custom installation, and that you select everything including DB2 Text Search (which is not checked by default).
</p>
<p>
	After you&#8217;ve started DB2 with <code>db2start</code> via the instance user (e.g., <code>db2inst1</code>,) launch the text search server by running:
</p>
<pre class="highlight">
db2ts start for text
</pre>
<p>
	To enable text search for an existing database, run:
</p>
<pre class="highlight">
db2ts enable database for text connect to mydb
</pre>
<p>
	Next, you&#8217;ll need to create a text search index and populate it. For example:
</p>
<pre class="highlight">
db2ts "create index customer_name for text on customers(name) connect to mydb"
db2ts "update index customer_name for text connect to mydb"
</pre>
<p>
	That&#8217;s it. From now on you&#8217;ll be able to use functions such as <code>CONTAINS</code> to quickly search for your data.
</p>
<p>
	Such a function can also be easily invoked in Rails:
</p>
<div class="highlight">
<pre><span class="no">Customer</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="s2">&quot;CONTAINS(name, ?) = 1&quot;</span><span class="p">,</span> <span class="nb">name</span><span class="p">)</span>
</pre>
</div>
<p>
	Or wrapping it a little in a model:
</p>
<div class="highlight">
<pre><span class="k">class</span> <span class="nc">Customer</span> <span class="o">&lt;</span> <span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span>
  <span class="c1"># ... </span>
  <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">search</span><span class="p">(</span><span class="nb">name</span><span class="p">,</span> <span class="n">max_res</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span>
    <span class="n">where</span><span class="p">(</span><span class="s1">&#39;CONTAINS(name, ?) = 1&#39;</span><span class="p">,</span> <span class="nb">name</span><span class="p">)</span><span class="o">.</span>
    <span class="n">order</span><span class="p">(</span><span class="s1">'name'</span><span class="p">)</span><span class="o">.</span>
    <span class="n">limit</span><span class="p">(</span><span class="n">max_res</span><span class="p">)</span>
  <span class="k">end</span>
<span class="k">end</span>
</pre>
</div>
<p>
Which can then be invoked as follows:
</p>
<div class="highlight">
<pre>
<span class="no">Customer</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s2">&quot;micro&quot;</span><span class="p">)</span>
</pre>
</div>
<p>
	(Technically we wouldn&#8217;t have needed <code>limit</code>, so long as we passed <code>RESULTLIMIT</code> to the <code>CONTAINS</code> function.)
</p>
<p>
	You can read more about <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.ts.doc/doc/c0051296.html">DB2 Text Search</a> at the Information Center.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Ruby on Rails and DB2 on Ubuntu 11.04</title>
		<link>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/</link>
		<comments>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/#comments</comments>
		<pubDate>Wed, 11 May 2011 21:10:56 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1372</guid>
		<description><![CDATA[In this tutorial I&#8217;ll show you how to create a complete Ruby on Rails setup for DB2 on Ubuntu. Following my step-by-step instructions, you&#8217;ll be able to install the following components: Ruby 1.8.7 Rubygems Ruby on Rails DB2 Express-C 9.7.4 The official Ruby driver and Rails adapter for DB2 Installing Ruby We are going to [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;ll show you how to create a complete Ruby on Rails setup for DB2 on Ubuntu. Following my step-by-step instructions, you&#8217;ll be able to install the following components:</p>
<ul>
<li>Ruby 1.8.7</li>
<li>Rubygems</li>
<li>Ruby on Rails</li>
<li><a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.4</a></li>
<li><a href="https://rubyforge.org/projects/rubyibm/">The official Ruby driver and Rails adapter for DB2</a></li>
</ul>
<h3 id="installing_ruby">Installing Ruby</h3>
<p>We are going to install Ruby 1.8.7 using the Debian packages that are available in the default repositories:</p>
<pre class="highlight">$ sudo apt-get install ruby-full</pre>
<p>Next we&#8217;ll build Rubygems from scratch, so as to obtain a recent version and be able to update it to the latest one via the gem system itself:</p>
<pre class="highlight">$ cd /tmp/
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
$ tar xvfz rubygems-1.7.2.tgz
$ cd rubygems-1.7.2
$ sudo ruby setup.rb
$ sudo gem update --system</pre>
<p>You can now verify that Rubygems is correctly installed:</p>
<pre class="highlight">$ gem -v
1.8.1</pre>
<p>Note: If you plan to have multiple versions of Ruby, you&#8217;ll probably want to look into RVM.</p>
<h3 id="installing_rails">Installing Rails</h3>
<p>We are not going to install the Rails package that ships with Ubuntu, because this is also quite obsolete at this stage. Instead, we&#8217;ll use the newly installed gem command:</p>
<pre class="highlight">$ sudo gem install rails</pre>
<p>(Add the <code>--no-rdoc --no-ri</code> flags if you don&#8217;t care about the local documentation. This will speed up the installation process.)</p>
<p>You can verify the installed version by running:</p>
<pre class="highlight">$ rails -v
Rails 3.0.7</pre>
<p></p>
<h3 id="installing_db2">Installing DB2</h3>
<p>We can now download and install <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.4</a>. <a href="http://db2express.com/download/?S_TACT=ACDB201">Download the .tar.gz installation file</a> to a location that&#8217;s convenient for you. Then proceed to unpack it:</p>
<pre class="highlight">$ cd ~/Downloads/
$ tar xvfz db2exc_974_LNX_x86.tar.gz
$ cd expc</pre>
<p>We&#8217;ll install one required library and then proceed with the setup:</p>
<pre class="highlight">$ sudo apt-get install libaio1
$ sudo ./db2setup</pre>
<p>Follow the GUI wizard on screen to continue with the installation. Pay close attention to two steps:</p>
<ul>
<li>When prompted <strong>select a custom installation</strong>, and when choosing the components, select all of them We&#8217;ll need the <strong>Application Development Tools</strong> in order to build the Ruby driver later on. (And these are unchecked by default.)</li>
<li>When asked if you&#8217;d like to <strong>create an instance user</strong>, go with that option. It greatly simplifies the setup process.</li>
</ul>
<p>When the setup of DB2 is completed, you should receive a confirmation message informing you about the successful installation.</p>
<p>For good measure, add the following line to your <code>~/.bashrc</code> file:</p>
<pre class="highlight">. /home/db2inst1/sqllib/db2profile</pre>
<p>This ensures that even your regular, non-DB2, user will be able to connect and interact with the database.</p>
<h3 id="installing_the_ibm_db_gem">Installing the ibm_db gem</h3>
<p>The last step we need to take is to install the ibm_db gem, which includes the IBM released (and supported) open source driver for Ruby, as well as the adapter for Rails. You&#8217;ll need these in order to use Rails with DB2.</p>
<p>Open a new shell and run:</p>
<pre class="highlight">$ sudo -s
$ export IBM_DB_INCLUDE=/home/db2inst1/sqllib/include
$ export IBM_DB_LIB=/home/db2inst1/sqllib/lib
$ . /home/db2inst1/sqllib/db2profile
$ gem install ibm_db
$ exit</pre>
<p>At the time of writing, this installs ibm_db-2.5.6.</p>
<h3 id="a_quick_sanity_test">A quick sanity test</h3>
<p>To ensure that all is well with your setup, run the following command:</p>
<pre class="highlight">$ rails new db2test -d ibm_db
$ cd db2test</pre>
<p>Now, edit <code>config/database.yml</code> so that the development section uses the same password you specified for the <code>db2inst1</code> user during the installation of DB2. Change the database name to something like <code>db2test</code>. The section should look like the example below:</p>
<pre class="highlight">development:
	adapter: ibm_db
	username: db2inst1
	password: secret
	database: db2test</pre>
<p>Create the database <code>db2test</code> by running:</p>
<pre class="highlight">$ su - db2inst1
$ db2start
$ db2 create db db2test
$ exit</pre>
<p>Depending on your hardware specs, the infrequent operation of creating a database can take quite a long time (e.g., minutes).</p>
<p>We will now install/attach the required gems for this project:</p>
<pre class="highlight">$ bundle install</pre>
<p>For the sake of a quick example, we&#8217;ll use scaffold to generate some super-basic code. We&#8217;ll then run migrations, and the built-in web server:</p>
<pre class="highlight">$ rails g scaffold Subject name:string
$ rake db:migrate
$ rails s</pre>
<p>Visit <code>http://localhost:3000/subjects</code> and you should see a scaffold interface you can use to create, edit, show, and destroy subjects, as I&#8217;ve done in the screenshot below.</p>
<p align="center"><a href="http://programmingzen.com/wp-content/uploads/2011/05/subjects-sample.png"><img src="http://programmingzen.com/wp-content/uploads/2011/05/subjects-sample.png" alt="subjects-sample" title="subjects-sample" width="401" height="349" class="aligncenter size-full wp-image-1373" /></a></p>
<p>Note: As you develop, you&#8217;ll probably want to use a better web server such as mongrel, unicorn, or thin. You can easily do so by editing your <code>Gemfile</code> and installing the gem via <code>bundle</code>.</p>
<h3 id="if_you_need_help">Getting help</h3>
<p>IBM is the only database vendor to officially provide and support its Ruby driver and Rails adapter. While commercial 24/7 DB2 support is certainly available and relatively inexpensive (i.e., <a href="http://www.db2teamblog.com/2010/12/treat-yourself-to-db2-this-holiday.html">cheaper than MySQL</a>), your first line of defense is posing your questions in the <a href="https://rubyforge.org/forum/forum.php?forum_id=9503">support forum</a> over at Rubyforge. Alternatively, if the question is DB2-specific and not related to Ruby or Rails, you can use the <a href="http://www.ibm.com/developerworks/forums/forum.jspa?forumID=805">DB2 Express-C forum</a> over at developerWorks instead.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Review of Rails Best Practices</title>
		<link>http://programmingzen.com/2011/04/20/review-of-rails-best-practices/</link>
		<comments>http://programmingzen.com/2011/04/20/review-of-rails-best-practices/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 17:19:39 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1342</guid>
		<description><![CDATA[Over the weekend I had a chance to play around a bit with Rails Best Practices, so I thought I’d share a few thoughts I had regarding it. In the startup world we often debate the merit of ideas vs execution. In this particular case, the idea behind this product is pretty straightforward. It’s a [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I had a chance to play around a bit with <a rel="nofollow" target="_blank" href="http://zfer.us/kZw1U">Rails Best Practices</a>, so I thought I’d share a few thoughts I had regarding it.</p>
<p>In the startup world we often debate the merit of ideas vs execution. In this particular case, the idea behind this product is pretty straightforward. It’s a video course about common idioms and best practices in Rails, that helps you learn how to refactor bad Rails code/anti-patterns/habits into good ones.</p>
<p align="center">
<div id="attachment_1345" class="wp-caption aligncenter" style="width: 610px"><a rel="nofollow" target="_blank" href="http://programmingzen.com/wp-content/uploads/2011/04/rails-best-practices-large.png"><img src="http://programmingzen.com/wp-content/uploads/2011/04/rails-best-practices-small.png" alt="Rails Best Practices" title="Rails Best Practices" width="600" height="335" class="size-full wp-image-1345" /></a>
<p class="wp-caption-text">Click to enlarge</p>
</div>
<p>As is often the case, the implementation is what makes this course really worthwhile. It’s Khan Academy meets Rails (and Khan Academy truly is <a rel="nofollow" target="_blank" href="http://www.ted.com/talks/salman_khan_let_s_use_video_to_reinvent_education.html">the future of education</a>).</p>
<p><a rel="nofollow" target="_blank" href="http://zfer.us/kZw1U">Rails Best Practices</a> provides a series of small videos that show examples of common bad code that may be used when trying to resolve a particular problem, then they introduce a refactoring that uses best practices to make the code a lot better.</p>
<p>In the process, these videos end up introducing some of the latest tools and features that are available in Rails 3. So if you haven’t made the switch yet from Rails 2 to Rails 3, you’ll find the videos particularly interesting.</p>
<p>This course isn’t just a collection of well produced videos and downloadable slides though. It’s dived into five levels, akin in that regard to a video game. To proceed to the next level, you need to correctly complete and submit all of the exercises for the current level. Each exercise will award you 250 points.</p>
<p>While working on very practical exercises, you’ll be able to reference the videos and re-watch them as often as you please. You’re also able to make mistakes and then see the exceptions that are raised by Ruby.</p>
<p align="center">
<div id="attachment_1347" class="wp-caption aligncenter" style="width: 610px"><a rel="nofollow" target="_blank" href="http://programmingzen.com/wp-content/uploads/2011/04/rails-best-practices-exercises-large.png"><img src="http://programmingzen.com/wp-content/uploads/2011/04/rails-best-practices-exercises-small.png" alt="Rails Best Practices Exercises" title="Rails Best Practices Exercises" width="600" height="334" class="size-full wp-image-1347" /></a>
<p class="wp-caption-text">Click to enlarge</p>
</div>
<p>When you complete a level, you’re awarded a badge. As well you’ll receive a few bonuses once you’ve completed the whole course (including a free peepcode.com screencast, $5 codeschool.com credit towards your next purchase, and 35% off all books at InformIT).</p>
<p>I’m a firm believer that the approach to learning in which one is taught by doing exercises in a game-like setting is a highly effective way to help retain the material you’ve has studied. (I should mention that there is a support forum as well, just in case you’re stuck or need some help.)</p>
<p>At $75, this course isn’t exactly a bargain basement deal, however it’s currently on sale for a considerably <a rel="nofollow" target="_blank" href="http://zfer.us/kZw1U">more wallet friendly $45</a>, and you’ll definitely get your money’s worth if you are a Rails developer.</p>
<p>In conclusion, given that levels are not visible until you pass them, here is the complete table of content, including all the levels, for this course.</p>
<p><strong>Level 1 &amp; 2</strong></p>
<ul>
<li>Skinny Controller, Fat Model</li>
<li>Scope it out</li>
<li>Fantastic Filters</li>
<li>Nested Attributes</li>
<li>Models without the DB</li>
<li>Really REST</li>
<li>Enter the Presenters</li>
<li>Memoization</li>
<li>Reject SQL Injection</li>
<li>Rails 3 Responder Syntax</li>
</ul>
<p><strong>Level 3 and 4</strong></p>
<ul>
<li>Loving your Indices</li>
<li>Protecting your Attributes</li>
<li>Default Values</li>
<li>Proper use of Callbacks</li>
<li>Sowing the Seeds</li>
<li>N + 1 is not for fun</li>
<li>Counter Cache Money</li>
<li>Batches of Find Each</li>
<li>Law of Demeter</li>
<li>to_s &amp; to_param</li>
</ul>
<p><strong>Level 5</strong></p>
<ul>
<li>No Queries in your View</li>
<li>Helper Skelter</li>
<li>Partial Sanity</li>
<li>Empty String Things</li>
<li>Yield to the content_for</li>
<li>Meta Yield</li>
<li>Rock your Block Helpers</li>
</ul>
<p>All in all, I was very pleased with this enjoyable course, and I think that beginner to intermediate Rails developers are the ones who stand to get the most out of it.</p>
<p><em>Full disclosure: I was granted access to the course for free, and <a rel="nofollow" target="_blank" href="http://zfer.us/kZw1U">the link to the course</a> contains my affiliate id. Nevertheless, everything above is my frank and honest opinion.</em></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/04/20/review-of-rails-best-practices/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Running Radiant CMS on DB2 in the Cloud</title>
		<link>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/</link>
		<comments>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 07:07:06 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1332</guid>
		<description><![CDATA[In this article I will show you how to set up and run Radiant CMS on DB2 Express-C in the Cloud. Before getting started, let’s define each of these components: Radiant CMS is a popular, easy to use open source Content Management System (CMS) that’s written in Ruby on Rails. DB2 Express-C is a fully [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>In this article I will show you how to set up and run Radiant CMS on DB2 Express-C in the Cloud. Before getting started, let’s define each of these components:</p>
<ul>
<li><a target="_blank" href="http://radiantcms.org/">Radiant CMS</a> is a popular, easy to use open source Content Management System (CMS) that’s written in Ruby on Rails.</li>
<li><a target="_blank" href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a> is a fully functional, free edition of DB2 which can be used in production for commercial purposes.</li>
<li>Cloud, in this particular context, refers to Amazon Web Services (AWS) that are managed with the aid of <a target="_blank" href="http://rightscale.com">RightScale</a> (an excellent Cloud management platform).</li>
</ul>
<h3 id="prerequisites">Prerequisites</h3>
<p>In order to run Radiant and DB2 in the Cloud and follow this tutorial, you’ll need to register with both Amazon Web Services and RightScale. You will also need to explicitly provide your AWS credentials to RightScale in order to manage Amazon’s services. If you haven’t taken these steps already, you can follow this <a target="_blank" href="http://vimeo.com/16093026">short screencast</a> to learn how to do so now.</p>
<div align=”center”><iframe src="http://player.vimeo.com/video/16093026?portrait=0&amp;color=c9ff23" width="600" height="323" frameborder="0"></iframe></div>
<p></p>
<h3 id="introduction_to_servertemplates">Introduction to RightScale ServerTemplates</h3>
<p>Rather than setting up the whole deployment stack from scratch, when using RightScale you can use special templates called RightScale ServerTemplates. These will take care of installing the required stack for you, thereby saving you time &#8211; and a possible headache, too.</p>
<p>IBM provides a RightScale ServerTemplate for your convenience called &#8220;Radiant CMS on IBM DB2 Express-C&#8221;, which installs Apache, Rails, Radiant, and DB2 on CentOS. Thanks to this template, it&#8217;s possible to have a Radiant and DB2 stack running in the Cloud in just a few minutes. This tutorial will show you how.</p>
<h3 id="creating_a_security_group">Creating a security group</h3>
<p>Before adding a server to our deployment we need to create a security group. This is a set of firewall rules that are used to define which ports are open on the server, as well as which IPs are accepted.</p>
<p>A security group is created within a specific geographical Cloud. For our particular ServerTemplate, the currently supported Clouds are US-East, US-West, EU, and AP-Singapore. AP-Tokyo is likely to be added in the upcoming weeks.</p>
<p>Select a Cloud of your choice (the closest one to you will do) and create a new security group from the Clouds menu as shown in the figure below.</p>
<p align="center">
<div id="attachment_1333" class="wp-caption aligncenter" style="width: 595px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/security-group.png" alt="Creating a security group" title="Creating a security group" width="585" height="299" class="size-full wp-image-1333" />
<p class="wp-caption-text">Creating a security group</p>
</div>
<p>You&#8217;ll be asked to provide a name for the group. It’s best to call it something meaningful, such as DB2 Public Access or Default Web Access. When prompted, you should open port 80 (for the web server) and port 50000 (for DB2), but you may want to enable port 22 as well for SSH access (admittedly not quite a best practice, but let&#8217;s keep things simple and standard), and any other port you think you may need. In the input mask, use 0.0.0.0/0 to indicate that all IPs are accepted for such ports.</p>
<p align="center">
<div id="attachment_1334" class="wp-caption aligncenter" style="width: 608px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/add-port-e1301983797980.png" alt="Opening port 80" title="Opening port 80" width="598" height="157" class="size-full wp-image-1334" />
<p class="wp-caption-text">Opening port 80</p>
</div>
<p></p>
<h3 id="adding_a_server_to_a_deployment">Adding a server to a deployment</h3>
<p>The first step will be importing IBM&#8217;s template in our RightScale account from the RightScale public Library. You can always find a link to said library by clicking on the Design menu and then on Library. There you&#8217;ll be able to search and browse all of the available templates. For your convenience, here’s a link you can click to bring you directly to the <a target="_blank" href="https://my.rightscale.com/library/server_templates/Radiant-CMS-on-IBM-DB2-Express/16950">Radiant CMS on IBM DB2 Express-C</a> template.</p>
<p>Click import and you&#8217;ll be prompted with a DB2 Express-C licensing agreement. Read it through (cough) and if you agree with the terms, click the accept check box and then Finish. The ServerTemplate will be imported for you, as shown in figure below.</p>
<p align="center">
<div id="attachment_1335" class="wp-caption aligncenter" style="width: 619px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/imported-server.png" alt="An imported server" title="An imported server" width="609" height="680" class="size-full wp-image-1335" />
<p class="wp-caption-text">An imported server</p>
</div>
<p>At this point, you can click Add To Deployment and select one of the available Clouds that are close to you (e.g., AWS US-East). Select the same Cloud you picked when creating a security group and then click Continue.</p>
<p>In the new popup dialog, you can select several parameters like Deployment, MultiCloud Image, Nickname, and so on. You can leave all the defaults on, but you should specify an Instance Type and Security Group(s). The former indicates what type of EC2 instance you need for your server (e.g., a micro instance), while the latter should be the security group (or groups) you created earlier on.</p>
<p>Keep in mind that Amazon will charge you based on an hourly basis, as well as depending on the instance type and Cloud you chose. A micro instance on the US-East Cloud as per this example is the cheapest solution. (Amazon even allows new customers to obtain a micro instance <a target="_blank" href="http://aws.amazon.com/free/">for free for the first year</a>.)</p>
<p>You will be redirected to the deployment you specified or that was selected by default (the default is unsurprisingly called Default). From this deployment you&#8217;ll be able to administer your instance of the server. (Note: You can always access your deployments from the Manage -> Deployments menu link.)</p>
<p>From within the Default deployment, start the server by clicking the triangular blue launch icon on the right side of the screen, which is located on the same line as your server&#8217;s nickname.</p>
<p align="center">
<div id="attachment_1336" class="wp-caption aligncenter" style="width: 610px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/launch-server-e1301984230933.png" alt="Launching a server" title="Launching a server" width="600" height="58" class="size-full wp-image-1336" />
<p class="wp-caption-text">Launching a server</p>
</div>
<p>On the new page that appears, click the Launch button. The server will boot and you&#8217;ll be brought back to your deployment. While the server boots, you should see several status update messages that will help keep you in the loop regarding the status of the server.</p>
<p>If all goes well, and depending on your Cloud/instance choices, you should have the server up and running (i.e., the status will be operational) in five minutes or less.</p>
<p>You can now click on the nickname of the server (e.g., Radiant CMS on IBM DB2 Express-C), where you&#8217;ll find a clickable link corresponding to the &#8220;Public DNS name&#8221;. If you click on this link a Radiant CMS installation should appear.</p>
<p align="center"><img src="http://programmingzen.com/wp-content/uploads/2011/04/radiant-e1301984520960.png" alt="Radiant on DB2" title="Radiant on DB2" width="599" height="481" class="aligncenter size-full wp-image-1337" /></p>
<p>Append /admin to that URL, and you&#8217;ll be able to login with the default username (admin) and password (radiant). From there you can experiment and change things as you wish in order to make the site yours. Your changes will be persisted in the database, even if you reboot your instance.</p>
<p>To learn more about how to use Radiant as you play around with it in the Cloud, feel free to consult the <a target="_blank" href="https://github.com/radiant/radiant/wiki/">official Radiant documentation</a>.</p>
<p>That&#8217;s it. Enjoy Radiant CMS and DB2 in the Cloud.</p>
<h3 id="important_notes">Important notes</h3>
<p>Remember to stop your server if you are not using it in production or if you were just experimenting with it and you don&#8217;t need it at the moment. Keep in mind that Amazon will charge you for the time you have the server up (unless of course you took advantage of the <a target="_blank" href="http://aws.amazon.com/free/">AWS Free Usage Tier</a>). You can stop a server from the deployment or by clicking the Stop button from the server information page where you found the public DNS name.</p>
<p>If you plan on keeping the server running, you must change your Radiant CMS admin password to a stronger and more secure one. You can do so from /admin, by clicking on the Users link at the top of the page, and then on Administrator.</p>
<p>At this time the ServerTemplate doesn&#8217;t allow you to change the password for DB2 users. You must do so manually from the console. It&#8217;s important that you change the password for the database/system users db2inst1, dasusr1, and db2fenc1 from &#8216;password&#8217; to more secure ones. If you don’t take this step, you run the risk of having your server hacked in no time. When you update the password for these three users, you also need to update the /opt/www/blog/config/database.yml file with the password you just changed for the database/system user db2inst1.</p>
<p>You can access a root SSH console for your server from the deployment area (when the server is running a small console icon is visible). Click on this icon, then select the type of console that you want to operate (OpenSSH or Mindterm), and accept the RSA key fingerprint that you’re presented with. As root you can fully manage the server, including changing passwords for users (e.g., passwd db2inst1).</p>
<p>Of course, if you are just demoing or experimenting for 15 minutes, you can probably ignore these password related steps (which are quick, but admittedly more tedious).</p>
<p>If you have any questions, please feel free to ask in the comment section or via email.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interview with Michael Hartl, author of the Rails 3 Tutorial</title>
		<link>http://programmingzen.com/2011/03/09/interview-with-michael-hartl-author-of-the-rails-3-tutorial/</link>
		<comments>http://programmingzen.com/2011/03/09/interview-with-michael-hartl-author-of-the-rails-3-tutorial/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 18:00:06 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1316</guid>
		<description><![CDATA[The following is an interview with Michael Hartl, author of the popular Rails 3 Tutorial. I want to thank Michael for his time and answers. Be sure to read until the end; as per Monday&#8217;s post, I&#8217;m doing a Twitter giveaway for this interview, too. 1. How did you go from Theoretical Physics to Ruby [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>The following is an interview with Michael Hartl, author of the popular <a href="http://zfer.us/hUnNL">Rails 3 Tutorial</a>. I want to thank Michael for his time and answers. Be sure to read until the end; as per Monday&#8217;s post, I&#8217;m doing a Twitter giveaway for this interview, too.</p>
<p><strong>1. How did you go from Theoretical Physics to Ruby Programming?</strong></p>
<p><img src="http://programmingzen.com/wp-content/uploads/2011/03/michael_hartl.jpg" alt="Michael Hartl" title="Michael Hartl" width="150" height="150" class="alignright size-full wp-image-1317" />I have a background in computational physics, and I learned Perl and then Python to avoid the pain of C/C++ as much as possible. (The core simulation code for my work was in C/C++ for speed, but I had lots of scripting needs as well, and using C/C++ for scripting would have been horrible.) That led naturally to experimenting with web programming, and I ended up writing my own half-baked web framework in Python. After Rails came out, I switched to Ruby, and haven&#8217;t looked back. (I generally prefer Ruby, but Python is also nice. I&#8217;ll remain silent on Perl. <img src='http://programmingzen.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p><strong>2. There wasn&#8217;t a lack of Ruby and Rails books when you started working on the <a href="http://zfer.us/hUnNL">Rails Tutorial</a>. What motivated you to create it?</strong></p>
<p>There were lots of Rails books, but there weren&#8217;t any that took the approach I wanted to take, namely, a single substantial sample application with features and pacing carefully chosen for pedagogical purposes. My first book, RailsSpace, filled that niche, but it was out-of-date, and I also perceived an opportunity with the (then-upcoming) release of Rails 3. I figured that <a href="http://zfer.us/hUnNL">a full-length tutorial book aimed at Rails 3</a> could find a broad audience.</p>
<p><strong>3. What would you say was your biggest challenge in preparing the tutorial?</strong></p>
<p>On a long-term project of this sort, it can be difficult to balance writing with the need to pay the bills. For a while at the beginning, I alternated between doing contract work and writing, and that takes its toll. Not only does contract work take time, but there is a also a big context switch when changing over to writing mode. Doing contract work was necessary given my financial situation at the time, but in the future I expect to be able to focus solely on writing and screencasting.</p>
<p><strong>4. You chose an approach rarely taken by traditional publishers, by producing a free HTML version of the Rails Tutorial, while providing a DRM-free PDF version and supplementary video lessons for a fee. How is the market treating you? Is it an approach that you&#8217;d recommend to fellow programmers?</strong></p>
<p>The market response has been great. The free HTML version has attracted lots of referrals and inbound links, which was its main strategic purpose, and it has also generated lots of good karma. Meanwhile, many people are happy to buy the PDF, which is easy to put on an iPad and can be read offline. Readers have also reported that having the PDF gives them a sense of ownership, and they also like knowing that they are supporting the Rails Tutorial project financially.</p>
<p>I have recommended this approach to other programmers (most recently in a talk at the Los Angeles Ruby Conference). Having a free HTML version is a business strategy, not charity, though it does feel good—I&#8217;ve gotten email from many readers, especially in poorer countries, thanking me for making the book available for free online.</p>
<p><strong>5. The book is also <a href="/recommends/?0321743121">in print</a> through the excellent Ruby series by Addison-Wesley. Did they reach out to you after the huge success of your online tutorial/video course or was there a plan of world domination all along?</strong></p>
<p>Partnering with a major publisher was part of the initial plan for world domination, but I didn&#8217;t think it was strictly necessary. The publisher and I attempted to get a deal in place before I wrote the book, but were unable to come to terms. After I finished the book, we got back in touch and worked out the details of a publication agreement. It&#8217;s an unusual arrangement, and I&#8217;m thankful to Addison-Wesley for being willing to try it out. Please go out and <a href="/recommends/?0321743121">buy the print edition</a> to reward them for their support of the Ruby community!</p>
<p><strong>6. Do you have any advice for people starting out with Rails (other than reading your book and watching your screencasts, of course)?</strong></p>
<p>Web development is hard, so be prepared for some challenges and occasional frustration. It&#8217;s especially good to pick a project you care about; that will help keep you motivated when the going gets tough.</p>
<p><strong>7. If you had a magic wand, what would you change in the Ruby/Rails ecosystem? And how can we make it happen without said magic wand?</strong></p>
<p>I&#8217;d make Ruby and Rails installation easier; the barrier to entry in some cases is still forbiddingly high. For example, a while back I spent a couple of hours just getting Ruby to compile after an upgrade to OS X Snow Leopard. (There was a subtle issue related to the location of the readline library headers.) Paradoxically, I think in the early years this may have benefited Rails by insuring that the typical Rails developer was both determined and highly skilled, but the Rails community has matured now to the point where lowering that barrier should be a priority. Happily, Engine Yard has hired the awesome Wayne E. Seguin (best known as the author of Ruby Version Manager, or RVM) to work on exactly this problem. The initial result, the <a href="http://railsinstaller.org/">Rails Installer</a> for Windows, looks promising, and I&#8217;m excited to see where that project goes from here.</p>
<p><strong>8. What&#8217;s next for you?</strong></p>
<p>My O(n) Rails Tutorial workload is minimal right now, which is a good sign, but I have a large O(1) work queue to complete. For example, I&#8217;m preparing a free screencast for buyers of the print edition, and I&#8217;ve committed to making the HTML book available for translation. Once that work queue cycles down to zero, I&#8217;m going to take a little time off, and then I&#8217;ll probably start making some more Rails- and Ruby-related products. Interested readers should subscribe to the <a href="http://news.railstutorial.org/">Rails Tutorial news feed</a> to be notified when future products are available. In addition, anyone who buys the <a href="http://zfer.us/hUnNL">Rails Tutorial PDF/screencast bundle</a> will likely be pleasantly surprised by exclusive coupon codes when the time comes. (Well, they won&#8217;t be surprised now, but you get the idea. <img src='http://programmingzen.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p><strong>Book giveaway</strong>: I will randomly draw one person from among those who share (retweet) this interview on Twitter, and personally ship that person a free printed copy of the Rails 3 Tutorial. All you have to do to be entered in this giveaway is to <a href="http://twitter.com/share/?text=Interview%20with%20Michael%20Hartl,%20author%20of%20the%20Rails%203%20Tutorial.%20Retweet%20for%20a%20chance%20to%20win%20a%20copy:&#038;url=http://su.pr/198gFQ&#038;via=acangiano">tweet about this post</a>. I will announce the winner on Friday morning on <a href="http://twitter.com/acangiano">my twitter account</a> (follow me!) and in the comments below.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/03/09/interview-with-michael-hartl-author-of-the-rails-3-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The recommended Ruby and Rails book pages have been updated</title>
		<link>http://programmingzen.com/2010/12/20/the-recommended-ruby-and-rails-book-pages-have-been-updated/</link>
		<comments>http://programmingzen.com/2010/12/20/the-recommended-ruby-and-rails-book-pages-have-been-updated/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 21:00:39 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1277</guid>
		<description><![CDATA[During the holiday lull I managed to finally update the Ruby and Rails book pages. The Ruby page includes a few new titles and sees a few existing ones get the axe, as I took the major emphasis on Ruby 1.9 into consideration when updating this list of books. The Rails page is a complete [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>During the holiday lull I managed to finally update the <a href="http://programmingzen.com/ruby-and-rails-recommended-books/">Ruby</a> and <a href="http://programmingzen.com/rails-books/">Rails book pages</a>. The <a href="http://programmingzen.com/ruby-and-rails-recommended-books/">Ruby page</a> includes a few new titles and sees a few existing ones get the axe, as I took the major emphasis on Ruby 1.9 into consideration when updating this list of books.</p>
<p>The <a href="http://programmingzen.com/rails-books/">Rails page</a> is a complete rewrite as I&#8217;ve removed any trace of Rails 2 books. I outlined a useful path of Rails books to follow based on the few available titles that are up-to-date with the latest version of the framework.</p>
<p>It&#8217;s likely that more books on the subject will come out in the next few  months and as they do, I will update the list accordingly. That said, the existing Rails 3 books (or those that are just about to be released) are very valid, useful ones.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2010/12/20/the-recommended-ruby-and-rails-book-pages-have-been-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>StreamSend is looking for a senior (Rails) web developer</title>
		<link>http://programmingzen.com/2010/09/24/streamsend-is-looking-for-a-senior-rails-web-developer/</link>
		<comments>http://programmingzen.com/2010/09/24/streamsend-is-looking-for-a-senior-rails-web-developer/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 21:26:43 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1254</guid>
		<description><![CDATA[This is just a quick heads up for my US readers. Given the tough economy we&#8217;re all battling, I thought you might be interested in learning about a great employment opportunity. My friends at StreamSend are looking for a senior web developer (preferably one with Rails experience, however they don&#8217;t discriminate as long as you [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is just a quick heads up for my US readers. Given the tough economy we&#8217;re all battling, I thought you might be interested in learning about a great employment opportunity. My friends at <a href="http://www.streamsend.com/">StreamSend</a> are looking for a senior web developer (preferably one with Rails experience, however they don&#8217;t discriminate as long as you can learn quickly and have enough web development expertise to satisfy their requirements).</p>
<p>Based in San Francisco and Sacramento, StreamSend is made up of a group of really cool guys who &#8220;get&#8221; both Agile development and how to treat their employees. If you are looking for a great (and well paid) job in an economically stable (they&#8217;ve been around since 1998) and rapidly growing company, <a href="http://streamsend.jobscore.com/jobs/streamsend/senior-web-application-engineer/abCxF0-zCr3O4deJe4aGWH">apply here</a>.</p>
<p>If you follow this blog regularly you know that I normally don&#8217;t post job ads, but I can personally vouch for this position.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2010/09/24/streamsend-is-looking-for-a-senior-rails-web-developer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Padrino: a Ruby framework built upon Sinatra</title>
		<link>http://programmingzen.com/2010/06/11/padrino-a-ruby-framework-built-upon-sinatra/</link>
		<comments>http://programmingzen.com/2010/06/11/padrino-a-ruby-framework-built-upon-sinatra/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 12:56:07 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://antoniocangiano.com/?p=1189</guid>
		<description><![CDATA[From the Padrino&#8217;s site: Padrino is a ruby framework built upon the excellent Sinatra Microframework. Sinatra is a DSL for creating simple web applications in Ruby with speed and minimal effort. This framework makes it as fun and easy as possible to code increasingly advanced web applications by expanding upon Sinatra while maintaining the spirit [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2008/01/08/ramaze-a-ruby-framework-that-will-amaze/' rel='bookmark' title='Ramaze: a Ruby framework that will amaze'>Ramaze: a Ruby framework that will amaze</a></li>
<li><a href='http://programmingzen.com/2008/04/01/announcing-ruby-on-crack/' rel='bookmark' title='Announcing Ruby on Crack'>Announcing Ruby on Crack</a></li>
<li><a href='http://programmingzen.com/2008/07/11/this-week-in-ruby-july-11-2008/' rel='bookmark' title='This Week in Ruby (July 11, 2008)'>This Week in Ruby (July 11, 2008)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://www.padrinorb.com/guides">Padrino&#8217;s site</a>:</p>
<blockquote><p>Padrino is a ruby framework built upon the excellent Sinatra Microframework. Sinatra is a DSL for creating simple web applications in Ruby with speed and minimal effort. This framework makes it as fun and easy as possible to code increasingly advanced web applications by expanding upon Sinatra while maintaining the spirit that made it great.</p></blockquote>
<p>The Ruby community has plenty of web frameworks at this point. Padrino &mdash; self-described as &#8220;The Elegant Ruby Web Framework&#8221;  &mdash; is interesting because it&#8217;s built on top of Sinatra, it&#8217;s highly modular, quite fast, and provides a drop-in admin interface. It fits between Sinatra and a large framework like Rails.</p>
<p><img src="http://antoniocangiano.com/wp-content/uploads/2010/06/padrino.png" align="right" style="float: right" alt="Padrino" hspace="5" />If it wasn&#8217;t for the fact that Rails 3 is about to be released, Padrino may have had a fighting chance at acquiring a good market share within the Ruby community. Rails 3 is here though, and it too is very modular and fast. Plus, it&#8217;s hard to beat the huge ecosystem that&#8217;s already built around it.</p>
<p>That said, the presence of an admin interface, a la Django, and the Sinatra core are definitely inviting features. Check out <a href="http://www.padrinorb.com/guides">their documentation</a> and <a href="http://www.padrinorb.com/guides/blog-tutorial">screencast</a>, to see if you think it&#8217;s worth considering for your own web development needs.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2008/01/08/ramaze-a-ruby-framework-that-will-amaze/' rel='bookmark' title='Ramaze: a Ruby framework that will amaze'>Ramaze: a Ruby framework that will amaze</a></li>
<li><a href='http://programmingzen.com/2008/04/01/announcing-ruby-on-crack/' rel='bookmark' title='Announcing Ruby on Crack'>Announcing Ruby on Crack</a></li>
<li><a href='http://programmingzen.com/2008/07/11/this-week-in-ruby-july-11-2008/' rel='bookmark' title='This Week in Ruby (July 11, 2008)'>This Week in Ruby (July 11, 2008)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2010/06/11/padrino-a-ruby-framework-built-upon-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading to Rails 3</title>
		<link>http://programmingzen.com/2010/05/25/upgrading-to-rails-3/</link>
		<comments>http://programmingzen.com/2010/05/25/upgrading-to-rails-3/#comments</comments>
		<pubDate>Tue, 25 May 2010 07:12:12 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Featured Article]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Screencasts]]></category>

		<guid isPermaLink="false">http://antoniocangiano.com/?p=1179</guid>
		<description><![CDATA[Rails 3 is a major upgrade; using it almost feels like working with an entirely new framework. Porting existing applications and acquiring the skills required to build new ones entails a significant amount of effort. You could scout the net for bits and pieces of information, but that would be time consuming and possibly frustrating. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Rails 3 is a major upgrade; using it almost feels like working with an entirely new framework. Porting existing applications and acquiring the skills required to build new ones entails a significant amount of effort. You could scout the net for bits and pieces of information, but that would be time consuming and possibly frustrating. Thankfully there are resources available that have done the work for you, so you don&#8217;t have to waste time trying to figure out what&#8217;s new.</p>
<p>In this post, I&#8217;d like to point out a couple of resources that I think compliment each other well, and focus on how to upgrade applications, as opposed to simply providing you with a shopping list of features.</p>
<p>The first one is <a href="http://thinkcode.tv/catalog/upgrading-rails-3/">Upgrading applications to Rails 3</a>, a screencast that was just released by <a href="http://thinkcode.tv">ThinkCode.TV</a>. This screencast is almost an hour-long and shows you how to port a real world web application from Rails 2 to Rails 3. As such, it can be very useful if you have existing code that you&#8217;d like to port over to Rails 3. The author ported a few large applications to Rails 3, as he has solid experience with it. I&#8217;m biased of course, but I feel it&#8217;s well worth $8.99. (Today only, use the coupon <strong>RAILS3</strong> to purchase this Rails screencast for just $5.99.)</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="rails3.png" src="http://antoniocangiano.com/wp-content/uploads/2010/05/rails3.png" border="0" alt="rails3.png" width="550" height="323" /></p>
<p>The second resource is the <a href="http://www.railsupgradehandbook.com/">Rails 3 Upgrade Handbook</a> by&nbsp;Jeremy McAnally. It&#8217;s a beautiful PDF that succinctly explains what&#8217;s new in Rails 3, as well as how to upgrade your applications to the new edition of the framework. At 10c per page ($12 for 120 pages), it too is worth the money in my opinion.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="rails3uh.png" src="http://antoniocangiano.com/wp-content/uploads/2010/05/rails3uh.png" border="0" alt="rails3uh.png" width="400" height="355" /></p>
<p>Regardless of whether you end up buying these resources or not, I sure hope you have extensive test coverage for your existing Rails 2 applications. In my experience this is a must, because porting complex applications to Rails 3 without solid test support is a definite challenge. Nevertheless, I feel that this major upgrade is truly worth it. Rails 3 really brings Rails to a whole new level and we, as a community, should be proud and excited about what lies ahead of us.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2010/05/25/upgrading-to-rails-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IBM_DB 2.5.0 with support for Rails 3 is out</title>
		<link>http://programmingzen.com/2010/05/12/ibm_db-2-5-0-with-support-for-rails-3-is-out/</link>
		<comments>http://programmingzen.com/2010/05/12/ibm_db-2-5-0-with-support-for-rails-3-is-out/#comments</comments>
		<pubDate>Wed, 12 May 2010 12:06:33 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://antoniocangiano.com/?p=1162</guid>
		<description><![CDATA[This is a tiny post to let you know that IBM just released version 2.5.0 of the IBM_DB gem with support for the upcoming Rails 3. That&#8217;s what I call both proactive and a true testament of IBM&#8217;s commitment towards DB2 on Rails. Aside from providing a working adapter and driver before the new framework [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2010/01/21/db2-support-for-rubyrails-turns-2-0/' rel='bookmark' title='DB2 support for Ruby/Rails turns 2.0'>DB2 support for Ruby/Rails turns 2.0</a></li>
<li><a href='http://programmingzen.com/2010/03/30/db2-support-for-django-1-2-is-here/' rel='bookmark' title='DB2 support for Django 1.2 is here'>DB2 support for Django 1.2 is here</a></li>
<li><a href='http://programmingzen.com/2009/09/08/enabling-support-for-db2-and-pythondjangosqlalchemy-on-mac-os-x-snow-leopard/' rel='bookmark' title='Enabling support for DB2 and Python/Django/SQLAlchemy on Mac OS X Snow Leopard'>Enabling support for DB2 and Python/Django/SQLAlchemy on Mac OS X Snow Leopard</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This  is a tiny  post to let you know that IBM just released <a href="http://rubygems.org/gems/ibm_db">version 2.5.0 of the IBM_DB  gem</a> with support for the upcoming Rails 3. That&#8217;s what I call both  proactive  and a true testament of IBM&#8217;s commitment towards <a href="http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&#038;S_TACT=ACDB201">DB2</a> on Rails.</p>
<p>Aside from providing a working adapter and driver before the new  framework release is even out, this release has a few improvements  and fixes, such as getting rid of a minor bug related to prepared  statements and  has_many associations.</p>
<p>Finally, ibm_db 2.5 improves upon Unicode integration with support for any encoding format that&#8217;s permitted by Ruby 1.9.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2010/01/21/db2-support-for-rubyrails-turns-2-0/' rel='bookmark' title='DB2 support for Ruby/Rails turns 2.0'>DB2 support for Ruby/Rails turns 2.0</a></li>
<li><a href='http://programmingzen.com/2010/03/30/db2-support-for-django-1-2-is-here/' rel='bookmark' title='DB2 support for Django 1.2 is here'>DB2 support for Django 1.2 is here</a></li>
<li><a href='http://programmingzen.com/2009/09/08/enabling-support-for-db2-and-pythondjangosqlalchemy-on-mac-os-x-snow-leopard/' rel='bookmark' title='Enabling support for DB2 and Python/Django/SQLAlchemy on Mac OS X Snow Leopard'>Enabling support for DB2 and Python/Django/SQLAlchemy on Mac OS X Snow Leopard</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2010/05/12/ibm_db-2-5-0-with-support-for-rails-3-is-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

