<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2958021377042600373</id><updated>2012-02-07T01:38:59.432-08:00</updated><category term='ruby'/><category term='Aptana'/><category term='javascript'/><category term='debugging'/><category term='passwords'/><category term='custom form builder'/><category term='secure'/><category term='git commit message'/><category term='ruby rails nuby'/><category term='cucumber'/><category term='WebKit'/><category term='Capybara'/><category term='ruby rails nuby DNS'/><category term='sessions'/><category term='Linux installation'/><category term='pair programming'/><category term='rspec'/><category term='AjaxUpdater'/><category term='rails upgrade'/><category term='MacOSx'/><category term='PostgreSQL'/><category term='IE bug'/><category term='secure login error messages'/><category term='git'/><category term='migrations'/><category term='rails'/><category term='Eclipse'/><category term='Authlogic'/><category term='https'/><category term='breakpoint debugger'/><category term='rmagick'/><category term='subversion client'/><category term='ActiveScaffold'/><category term='SSL'/><category term='testing'/><category term='bdd'/><category term='capistrano pty deploy'/><category term='ActionMailer'/><category term='database'/><title type='text'>Nuby Ruby / Rails Tales</title><subtitle type='html'>Learning to use Ruby on Rails, or... the trials and tribulations (and jubilations) of a ruby nuby.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default?start-index=26&amp;max-results=25'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>47</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-5984772869243006601</id><published>2012-01-23T10:04:00.000-08:00</published><updated>2012-01-23T10:15:10.601-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='Capybara'/><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><category scheme='http://www.blogger.com/atom/ns#' term='WebKit'/><title type='text'>Cucumber, Capybara, and Webkit testing for Ajaxified actions</title><content type='html'>I recently upgraded my testing stack and now use Capybara and Webkit with Cucumber (and RSpec, too).  I ran into a number of problems and found &lt;a href="http://blog.mattheworiordan.com/post/4701529828/full-stack-integration-testing-with-rails-3-cucumber"&gt;this post&lt;/a&gt; by Mathew O'Riordan incredibly helpful. He tracks the history of his research and testing through a &lt;a href="https://github.com/mattheworiordan/Full-stack-testing"&gt;github project&lt;/a&gt; and at various points on the blog entry shows the commit for the changes he just discussed: kudos on that approach!&lt;br /&gt;&lt;br /&gt;A couple of gotchas that I ran into along the way:&lt;br /&gt;&lt;br /&gt;First, you may need to add the following line to your features/support/env.rb file:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;require 'capybara-webkit'&lt;/pre&gt;O'Riordan doesn't do this in his project, but I got an error:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;"no driver called :webkit was found, available drivers: :rack_test, :selenium (Capybara::DriverNotFoundError)"&lt;/pre&gt;and found &lt;a href="https://github.com/thoughtbot/capybara-webkit/issues/155"&gt;this discussion&lt;/a&gt; which gave me the solution.&lt;br /&gt;&lt;br /&gt;Second, although it may be obvious, I missed the fact that you MUST put&lt;br /&gt;&lt;pre class="brush: ruby"&gt;@javascript&lt;/pre&gt;before each scenario that requires in-browser javascript.  I had thought this was just a way of grouping scenarios together, but it actually triggers the use of the webkit driver to run the step.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-5984772869243006601?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/5984772869243006601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2012/01/cucumber-capybara-and-webkit-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5984772869243006601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5984772869243006601'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2012/01/cucumber-capybara-and-webkit-testing.html' title='Cucumber, Capybara, and Webkit testing for Ajaxified actions'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-2932983263329195778</id><published>2011-01-27T12:29:00.000-08:00</published><updated>2011-01-27T12:37:31.704-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='IE bug'/><title type='text'>Solving one IE rendering problem...</title><content type='html'>I know this has been posted elsewhere, but since I recently ran into the issue and had to do some digging and coding to work around it, I thought I'd post it for others to find.&lt;br /&gt;&lt;br /&gt;While working with a drop-down select box in a form, I wanted to be able to show/hide different sections of the form depending on the value of the selection (I'm currently using the Prototype javascript library for this project). It all worked fine in every browser except IE (surprise... NOT!).  IE was not setting the "value" property of the select box.&lt;br /&gt;&lt;br /&gt;After some testing, I found that IE DID properly set the selectedIndex attribute, so I could use that to get IE to work like I wanted it to; here's the code:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js"&gt;MHC.select_display = function(select_id, select_value, select_number, toggle_id) {&lt;br /&gt;/***&lt;br /&gt;* NOTICE IE6 properly sets the selectedIndex value but does NOT set the value property; therefore, we have to give both values to this routine&lt;br /&gt;* to handle both browsers.&lt;br /&gt;* alert("Hi - I've been changed! / " + select_id + " / " + select_value + " / " + toggle_id + " / " + $(select_id).selectedIndex + " / " +  $(select_id).options[$(select_id).selectedIndex].value + " / " + $(select_id).value) + " / " + $(select_id).options.value;&lt;br /&gt;**/     &lt;br /&gt;if(Prototype.Browser.IE) {&lt;br /&gt;  if($(select_id).selectedIndex == select_number) {&lt;br /&gt;    $(toggle_id).appear();&lt;br /&gt;    }&lt;br /&gt;  else {&lt;br /&gt;    $(toggle_id).hide();&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;else {&lt;br /&gt;  if($(select_id).options[$(select_id).selectedIndex].value == select_value) {&lt;br /&gt;    $(toggle_id).appear();&lt;br /&gt;    }&lt;br /&gt;  else {&lt;br /&gt;    $(toggle_id).hide();&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;};&lt;/pre&gt;While I don't know this for a fact, I'm guessing that other problems with IE form fields (such as checkboxes and the "checked" attribute) may be due to the timing of updates to the attributes; you may be able to find alternative attributes that you can interrogate to get things done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-2932983263329195778?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/2932983263329195778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/solving-one-ie-rendering-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2932983263329195778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2932983263329195778'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/solving-one-ie-rendering-problem.html' title='Solving one IE rendering problem...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-4212362937887099074</id><published>2011-01-25T11:52:00.000-08:00</published><updated>2011-01-25T11:54:49.040-08:00</updated><title type='text'>KPackagekit / aptitude woes... solved</title><content type='html'>Recently I was trying to make some updates to my Kubuntu 10.04 machine (where I do all my Rails development) and ran into a serious problem: both KPackagekit (KDE package manager) and aptitude were unable to even start.&lt;br /&gt;&lt;br /&gt;KPackagekit gives:&lt;br /&gt;&lt;pre class="brush: text"&gt;"an unknown error has occurred"&lt;/pre&gt;or &lt;br /&gt;&lt;pre class="brush: text"&gt;"The package list needs to be rebuilt. &lt;br /&gt;This should have been done by the backend automatically"&lt;/pre&gt;&lt;br /&gt;aptitude gives:&lt;br /&gt;&lt;pre class="brush: text"&gt;E: Read error - read (5: Input/output error)&lt;br /&gt;E: The package lists or status file could not be parsed or opened.&lt;/pre&gt;&lt;br /&gt;Turns out it was a "simple" problem -- Kpackagekit and aptitude are both based on the Debian APT package. That package manager has a built-in limit as to the amount of cache space that it supports. If you exceed that limit (by having a bunch of repositories and packages stored on disk in /var), then APT and its descendents just give up. The error messages above are indicative of this kind of error (and certainly aren't very descriptive).&lt;br /&gt;&lt;br /&gt;The problem is that - once you get to this point - you can't do much of anything. Attempts to run either command just fail.&lt;br /&gt;&lt;br /&gt;Searching for KPackagekit info yielded nothing useful, but when I searched on aptitude and its error message, I found the solution: increase the cache limit.&lt;br /&gt;&lt;br /&gt;Here's the &lt;a href="https://bugs.launchpad.net/debian/+source/apt/+bug/24626"&gt;source of this information&lt;/a&gt;. The fix is simple; just run this command and then you should be OK.&lt;br /&gt;&lt;pre class="brush: bash"&gt;sudo apt-get update -o APT::Cache-Limit=25165824&lt;/pre&gt;If you need, you can increase the Limit even further... it's only 24 megabytes which is nothing on today's systems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-4212362937887099074?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/4212362937887099074/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/kpackagekit-aptitude-woes-solved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4212362937887099074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4212362937887099074'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/kpackagekit-aptitude-woes-solved.html' title='KPackagekit / aptitude woes... solved'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-7843099426033831786</id><published>2011-01-13T17:05:00.000-08:00</published><updated>2011-01-15T13:00:32.017-08:00</updated><title type='text'>Excel spreadsheets &amp; Ruby =&gt; :tricky</title><content type='html'>I've been working on an ERP data conversion project, using Ruby to convert the data before it gets dumped into the Oracle database.&amp;nbsp; I only recently got involved to help out, and an earlier decision mandated that we produce our converted data in spreadsheets [I know, I know -- not what I would have decided, but they wanted folks to be able to easily manipulate the data].&lt;br /&gt;&lt;br /&gt;Anyway, we're using the Spreadsheet gem which is pretty nice; however, it does have some limitations, which can result in oblique error messages such as the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: bash; first-line: 10"&gt;ruby customer_fix_zip.rb&lt;br /&gt;/Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:376:in `validate!': OLE2 signature is invalid (Ole::Storage::FormatError)&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:368:in `initialize'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:110:in `new'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:110:in `load'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:77:in `initialize'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:83:in `new'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/ruby-ole-1.2.11.1/lib/ole/storage/base.rb:83:in `open'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/spreadsheet-0.6.5.0/lib/spreadsheet/excel/reader.rb:1144:in `setup'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/spreadsheet-0.6.5.0/lib/spreadsheet/excel/reader.rb:121:in `read'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/spreadsheet-0.6.5.0/lib/spreadsheet/excel/workbook.rb:32:in `open'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/spreadsheet-0.6.5.0/lib/spreadsheet.rb:62:in `open'&lt;br /&gt;    from /Users/jseidel/.rvm/gems/ruby-1.9.2-head/gems/spreadsheet-0.6.5.0/lib/spreadsheet.rb:68:in `open'&lt;br /&gt;    from customer_fix_zip.rb:12:in `'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Googling for help didn't... there are only a few posts out there about this situation, but not many responses.&lt;br /&gt;&lt;br /&gt;This may be caused by a password on the spreadsheet -- at least that was the cause in my case. Once I had removed the password protection, everything worked just fine.&amp;nbsp; Hopefully, this will help other folks out there who are experiencing the same problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-7843099426033831786?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/7843099426033831786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/excel-spreadsheets-ruby-tricky.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7843099426033831786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7843099426033831786'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2011/01/excel-spreadsheets-ruby-tricky.html' title='Excel spreadsheets &amp; Ruby =&gt; :tricky'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-2550784641799033754</id><published>2010-09-25T07:50:00.000-07:00</published><updated>2010-09-25T07:52:43.503-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom form builder'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Custom Form Builders in Rails...</title><content type='html'>I've started working on a new Rails application and needed to display chunks of spreadsheet-like text for financial data (e.g., Profit &amp;amp; Loss Statement and Balance Sheet). Everything went fine (well, not so fine: money fields were a bit of challenge, but more about that later) until I started displaying my data in a view. As you can imagine, there are a lot of cells for these displays and after some prototyping, I realized that the default size of 30 for an input field was just too big. Of course, that's easy to solve by just adding ":size =&amp;gt; 15" to the text_field definition, but the prospect of adding that to numerous fields and than probably having to change them all left me pretty grumpy.&amp;nbsp; That's when I figured that a Custom Form Builder would be the way to go.&lt;br /&gt;&lt;br /&gt;As usual, I headed off to the Rails API but found little there and much of the external documentation on how to use them was either way over-complicated for what I wanted to do, or going in another direction.&amp;nbsp; I did find a few good resources, including the following:&lt;br /&gt;&lt;br /&gt;1. &lt;a href="http://pragprog.com/screencasts/v-rbforms/mastering-rails-forms"&gt;Ryan Bates' "Mastering Rails Forms" episode 3&lt;/a&gt; - Great presentation; worth every penny of the $5 cost per episode.&lt;br /&gt;2. &lt;a href="http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for"&gt;APIDoc description of form_for method&lt;/a&gt; - APIDoc is your very good friend.&lt;br /&gt;3. &lt;a href="http://code.alexreisner.com/articles/form-builders-in-rails.html"&gt;Alex Reisner's "Anatomy of a Form Builder"&lt;/a&gt; - Best introduction of the details behind Form Builder I found.&lt;br /&gt;4. &lt;a href="http://rubypond.com/blog/sexy-forms-in-rails"&gt;Ruby Pond's Semantic Form Builder&lt;/a&gt; - Lots of complex changes, nicely done&lt;br /&gt;5. &lt;a href="http://www.aldenta.com/2006/09/19/writing-a-custom-formbuilder-in-rails/"&gt;Aldenta post with metaprogramming example&lt;/a&gt; - Shows how to replace a slew of methods with metaprogramming; compare to Ruby Pond example where they are all hand-crafted.&lt;br /&gt;&lt;br /&gt;Because of their often complicated solutions and the fact that there were different ways of doing things, I found it challenging to extract the minimum that I would have to do make a simple change. In the end, after much reading and trial coding, Ryan Bates' "Mastering Rails Forms, episode 3" completed my current understanding of the process. &lt;br /&gt;&lt;br /&gt;Here are the key points that I learned which finally helped me get through the morass and make it work for me. In the discussion that follows, CustomFormBuilder is my class name. &lt;br /&gt;&lt;br /&gt;To start, this is the code that I wanted to change...&lt;br /&gt;from this:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;&amp;lt;td&amp;gt;f.textfield :name, :size =&amp;gt; 12&amp;lt;/td&amp;gt;&lt;/pre&gt;to this:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;f.textfield :name&lt;/pre&gt;Not a big change at all, but with many lines like this, I thought this would be a nice, easy way to learn about custom form builders.&lt;br /&gt;&lt;br /&gt;Here's what I learned that helped me understand how it all works.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;1)&lt;/span&gt; the basic form builder code looks like this:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;class CustomFormBuilder &amp;lt; ActionView::Helpers::FormBuilder&lt;br /&gt; ...your code...&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;There may be other approaches out there that will work, but this is the most straight-forward way I have found.&lt;br /&gt;&lt;br /&gt;You want to be able to reference your custom form builder easily, as in:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;form_for :person, :builder =&amp;gt; CustomFormBuilder do |f|&lt;br /&gt;...form code...&lt;br /&gt;end&lt;/pre&gt;It turns out there are ways to customize even this, so that your code looks like this:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;custom_form_for :person do |f|&lt;br /&gt;...form code which automatically uses your CustomFormBuilder&lt;br /&gt;end&lt;/pre&gt;but that's for a little further down the page.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;2)&lt;/span&gt; There is more than one way to implement the logistics of a custom form builder (reminds me of Perl's &lt;a href="http://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it"&gt;TMTOWTDI&lt;/a&gt; and I am rapidly coming to the conclusion that this applies to Rails everywhere). This was one of the things that tripped me up at first, since different posts give different instructions on how to create your builder. By logistics I mean where do you put the code that will be your form builder so that you can reference it easily?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You can put it in a helper file... either in application_helper.rb or controller_helper.rb. The basic code layout is as described above... The really important thing about including this code in an existing helper file is that the code MUST come after the end statement that terminates the helper code! Failing to do this will result in your form builder not being found (this one cost me a few hours) or your having to reference it as:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;:builder =&amp;gt; ApplicationHelper::CustomFormBuilder&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;You can put it in a separate file in the helpers directory, with a name that matches the class name, i.e., custom_form_builder.rb&lt;/li&gt;&lt;li&gt;You can put it anywhere you like (for example, like Ryan Bates does, in a separate directory that you create called app/form_builders). In this case, however, you must add that directory to Rails' default search path by adding the following to your environment.rb file (just uncomment and modify the skeleton statements that's already there):&lt;br /&gt;&lt;pre class="brush: ruby"&gt;config.load_paths += %W( #{RAILS_ROOT}/app/form_builders)&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;3) &lt;/span&gt;You can make your CustomFormBuilder the default by adding the following to the bottom of your environment.rb file. Doing this means that you can leave off the :builder =&amp;gt; option in your form_for:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;ActionView::Base.default_form_builder = CustomFormBuilder&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;However, I think I agree with Ryan Bates that this is not such a great idea -- it hides what's going on and could make it difficult for some one new to your code to figure it out.&lt;/li&gt;&lt;li&gt;[Note]: Other authors recommend doing this in app/helpers/application_helper.rb and one author explicitly stated that the environment.rb approach would not work because helpers don't get initialized until they are actually called/used {could this be a version-dependent issue?]&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;4) &lt;/span&gt;Altlernatively, you can make a helper method that encapsulates the CustomFormBuilder and makes it explicit that you've got some extra magic going on. Do this in your Application Helper file:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;def custom_form_for(*args, &amp;amp;block)&lt;br /&gt;&amp;nbsp; options = args.extract_options!&lt;br /&gt;&amp;nbsp; options.merge(:builder =&amp;gt; CustomFormBuilder)&lt;br /&gt;&amp;nbsp; form_for(*(args + [options]), &amp;amp;block)&lt;br /&gt;end&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;Again, Ryan Bates in his "Mastering Rails Forms" episode 3, had the clearest description that I have found but there is an essentially identical representation at&amp;nbsp;&lt;a href="http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for"&gt;http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for&lt;/a&gt;&amp;nbsp;and a pretty good description of the whole form builder approach.&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;5)&lt;/span&gt; The code to actually do this very simple change is also very simple:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;def text_field(name, options = {})&lt;br /&gt;  options.reverse_merge! (:size =&amp;gt; 12)&lt;br /&gt;  @template.content_tag(:td, super)&lt;br /&gt;end&lt;/pre&gt;&lt;ul&gt;&lt;li&gt;The "reverse_merge" is so that I can override the default size of 12 with another value coded in the form&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;6)&lt;/span&gt; You'll see in some of the examples that the method signature is given with *args instead of option as I have shown it. That's a more general approach, but requires that you know a little more about how Rails can manipulate the arguments; see below. Suffice it to say that it works for my simple example, but if you're going to get serious about making more complicated customm form builders, you should get familiar with the following approaches.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;a href="http://apidock.com/rails/ActiveSupport/CoreExtensions/Array/ExtractOptions/extract_options!"&gt;extract_options!&lt;/a&gt;&lt;/u&gt;&lt;/b&gt; is a Rails method that will -- not surprisingly -- pull the options hash out of the method arguments. Very useful for the general method signature which uses *args.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;merge!&lt;/u&gt;&lt;/b&gt; and &lt;b&gt;&lt;u&gt;reverse_merge!&lt;/u&gt;&lt;/b&gt; are methods that will merge and overwrite the receiving hash with the results. So, for example:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;options.merge!(:size =&amp;gt; 12)&lt;/pre&gt;will add :size =&amp;gt; 12 to the options hash, while:&lt;br /&gt;&lt;pre class="brush: ruby"&gt;options.reverse_merge!(:size =&amp;gt; 12)&lt;/pre&gt;will add :size =&amp;gt; 12 to the options hash ONLY if there is no :size element already there.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Note the bang (!) on each of these methods -- very important. If you use the non-bang version, you won't update the options hash and things just won't work.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;a href="http://apidock.com/rails/ActionView/Helpers/TagHelper/content_tag"&gt;content_tag&lt;/a&gt;&lt;/u&gt;&lt;/b&gt; is a method on the @template object (provided to you by the FormBuilder) that wraps selected text in the given HTML tag. Very useful for building your output string.&lt;br /&gt;&lt;hr /&gt;There's lots more, but that should be enough to get you started -- hopefully a little easier than I did. Now that I understand some of these basics, looking at the more complicated examples is much easier for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-2550784641799033754?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/2550784641799033754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/09/custom-form-builders-in-rails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2550784641799033754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2550784641799033754'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/09/custom-form-builders-in-rails.html' title='Custom Form Builders in Rails...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-7068673843063237296</id><published>2010-08-24T17:57:00.000-07:00</published><updated>2010-09-28T04:35:13.995-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux installation'/><title type='text'>Firing up a new Kubuntu machine for Rails development...</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Well... it finally happened.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;My Kubuntu machine which I prefer to use for Rails development was getting pretty crochety. I had started out on 7.04, did a distribution upgrade to 8.04, ran into some major problems installing DropBox (&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.linuxformat.com/"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;LinuxFormat Magazine&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; helped me fix this problem). Finally, I tried a distribution upgrade to 9.10 and it was barely limping along. Several folks suggested a clean install from scratch, so I decided to go with Kubuntu, 10.04, 64-bit. &amp;nbsp;Here's how I went about it.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Prior to the installation, I took a tar backup of my system and also did a copy (cp -a ...) to an external USB drive. Be careful with cp: if you have other media attached (like another network-attached drive I had a /media/wdhd1), the command "cp -a / /&lt;usb-drive&gt;" will follow all those links and try to get EVERYTHING onto the USB drive. I wound up simply copying over the directories that I was most interested in gaining quick access to, such as: /home, /etc, /root, /rails-app. If you've got an old system that you're going to replace, pick the directories that you don't want to lose.&lt;br /&gt;&lt;/usb-drive&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;BTW, I really like the &lt;/span&gt;&lt;a href="http://www.iocellnetworks.com/"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;NDAS combo drives&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;: eSata, Network-Direct Attached, USB. Reasonably-priced and very effective.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ol id="internal-source-marker_0.8316391922267606"&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;First get Kubuntu (or whatever flavor of Linux distro you want). I went to the Kubuntu site at &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;a href="http://www.kubuntu.org/getkubuntu"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://www.kubuntu.org/getkubuntu&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; where you can either download directly or get a CD/DVD. I downloaded the 64-bit desktop version here: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;a href="http://www.kubuntu.org/getkubuntu/download#download-block"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://www.kubuntu.org/getkubuntu/download#download-block&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Install kubuntu - pretty straight-forward.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Make sure that your machine will boot from a CD&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Insert CD, reboot, follow the instructions.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;A  true linux sysadmin might have gotten fancy with the disk partitioning,  but I just went with the default which was everything in a single  partition. It’s not like this is a heavily-loaded server...right?&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;There were a number of prompts for keeping or replacing existing files (such as mysql/mycnt, /etc/apcupsd/apcupsd.conf, /etc/cups/cupsd.conf, etc...) and I just took the default since I had copies of all my previous config files.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;At one point, my mouse went inactive (I connect it through a KVM switch) but that cleared up pretty quickly.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Install your favorite browser by using Kubuntu’s built-in Konqueror browser. I  chose Chrome -- I’ve been using Firefox for years, but in the past, I’ve  run into problems with Firefox on Linux: older versions, conflicts when  trying to upgrade... I still use FireFox on Windows/Mac, but Chrome is  my preferred browser for Linux.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The Ubuntu community has a very good site on how to do the Rails install: &lt;/span&gt;&lt;/span&gt;&lt;a href="https://help.ubuntu.com/community/RubyOnRails"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;https://help.ubuntu.com/community/RubyOnRails&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Make  sure you DO NOT do “sudo apt-get install rails”. This gives you an old  version and you can’t track your gems easily. If you mistakenly do that,  simply type “sudo apt-get remove rails” and go back to the above link&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;REMEMBER to add the new ruby gems path to your path so that your system can find the stuff you just installed (this is in the . The command is: &lt;br class="kix-line-break" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;“&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #f0eee6; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;export PATH=/var/lib/gems/1.8/bin:$PATH”&lt;br class="kix-line-break" /&gt;You’ll have to add this to your .bashrc file so that it will always be done when you start up.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="background-color: #f0eee6; color: black; font-family: Verdana; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-roman; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;BTW,  I add the following two aliases to my .bashrc so that I can quickly and  easily edit .bashrc and update my environment for any new values&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias brcs='source /home/jseidel/.bashrc'&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;alias brcvi='vi /home/jseidel/.bashrc'&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-roman; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;The  ‘brcvi’ alias drops me into vi (replace with your preferred editor) so  that I can make changes. Notice that it always points to my home  directory so that I can do this regardless of where I am.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-roman; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;the  ‘brcs’ alias “sources” the current/updated .bashrc file. I.e., it  “Reads &amp;nbsp;and &amp;nbsp;executes &amp;nbsp;commands &amp;nbsp;from .bashrc in the current shell  environment”, with the result that the changes you made are reflected in  your current bash environment. So to add a new alias, I create the  alias in my current bash, test it out, then brcvi to add it to my  .bashrc and then brcs to make it active and then test to make sure I  didn’ have a typo.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Install git -- you are using git, aren’t you? GitHub has a great tutorial on how to do this. Just go to: &lt;/span&gt;&lt;/span&gt;&lt;a href="http://help.github.com/linux-git-installation/"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://help.github.com/linux-git-installation/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and follow the instructions. There's also an excellent book, &lt;u&gt;Pro Git&lt;/u&gt;, by Scott Chacon, that is available on line at &lt;a href="http://progit.org/book/"&gt;http://progit.org/book/&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Once you’ve installed git, you have to generate an SSH keypair (see &lt;/span&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Secure_Shell"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://en.wikipedia.org/wiki/Secure_Shell&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; if you want to learn more about SSH and &lt;/span&gt;&lt;/span&gt;&lt;a href="http://en.wikipedia.org/wiki/Public-key_cryptography"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://en.wikipedia.org/wiki/Public-key_cryptography&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  if you want to learn more about keypairs) so that you can speak  encrypted git. &amp;nbsp;GitHub has another excellent tutorial on how to do this;  see &lt;/span&gt;&lt;/span&gt;&lt;a href="http://help.github.com/linux-key-setup/"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://help.github.com/linux-key-setup/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;.  Just follow the instructions there and you should have no problem. I  did install the xclip utility -- makes it easy to copy/paste the  information into github.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;If you don’t want to key-in your SSH passphrase everytime you use it, GitHub has help here as well. Go to &lt;/span&gt;&lt;/span&gt;&lt;a href="http://help.github.com/working-with-key-passphrases/"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://help.github.com/working-with-key-passphrases/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  and about half-way down the page there’s a section on “autolaunching  ssh-agent” when you start your machine so that you only have to enter  the passphrase once when you boot your machine.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Turns  out I had some permissions problem in my .ssh directory: I kept getting &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;“Bad owner or permissions on /home/jseidel/.ssh/config” &lt;br /&gt;when testing  things with “ssh git@github.com”. &amp;nbsp;Well, GitHub was there again, with  their trouble-shooting page at &lt;/span&gt;&lt;/span&gt;&lt;a href="http://help.github.com/troubleshooting-ssh/"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://help.github.com/troubleshooting-ssh/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. Towards the bottom of the page in the “SSH Config” section, the two ‘chmod’ commands did the trick for me.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 17px; white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;chmod 700 ~/.ssh&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 17px; white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;chmod 600 ~/.ssh/*&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;And don’t forget to setup your git config options -- at least these two&lt;br class="kix-line-break" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;git config --global user.name "your name"&lt;br class="kix-line-break" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;git config --global user.email your@email.com&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I use RubyMine &lt;/span&gt;&lt;/span&gt;&lt;a href="https://docs.google.com/a/edpci.biz/document/edit?id=1ang7UlitjQRU54Gwju3VjeTXG3JhpjYiekzdPoK0Wzk&amp;amp;hl=en"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;(http://www.jetbrains.com/ruby/download/index.html#linux&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  for a 30-day free trial) so that was the next thing to install. Replace  this section with whatever IDE you prefer: Aptana, NetBeans, ... &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;To run RubyMine, you have to have the Sun Java (JDK 1.6). I found that at &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and followed the instructions. It turned out to be completely straight-forward.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Now you’ve got everything ready to do; let’s create your first rails app in your shiny new Linux development machine:&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;rails MyApp&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;cd MyApp&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;git init&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;git commit -m "Empty Rails application"&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Now create your github repository -- GitHub has the answer again: &lt;/span&gt;&lt;/span&gt;&lt;a href="http://help.github.com/creating-a-repo/"&gt;&lt;span style="background-color: transparent; color: #000099; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;http://help.github.com/creating-a-repo/&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Once this is done, copy in the repository URL&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Back to bash and hooking up your new repository with your new rails app&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;ol&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Tell your local git repository about the github repository: &lt;br class="kix-line-break" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;git branch add origin &lt;github myapp="" url=""&gt;&lt;/github&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Push your MyApp rails application up to github:&lt;br class="kix-line-break" /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;git push origin master&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;And you should be good-to-go -- happy rails to you!&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-7068673843063237296?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/7068673843063237296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/08/firing-up-new-kubuntu-machine-for-rails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7068673843063237296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7068673843063237296'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/08/firing-up-new-kubuntu-machine-for-rails.html' title='Firing up a new Kubuntu machine for Rails development...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-7657574390838576607</id><published>2010-05-26T17:23:00.000-07:00</published><updated>2010-05-26T17:23:57.993-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux installation'/><category scheme='http://www.blogger.com/atom/ns#' term='rmagick'/><title type='text'>RMagick (finally) installed on Kubuntu...</title><content type='html'>Start with the very well-done RMagick installation FAQ at: &lt;a href="http://rmagick.rubyforge.org/install-faq.html"&gt;http://rmagick.rubyforge.org/install-faq.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;./configure runs OK, then make throws this error: &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "error: ‘png_info’ has no member named ‘trans’"&lt;br /&gt;&lt;br /&gt;After much searching and trying, ran into several other errors, and finally realized I had to install the ImageMagick development support package&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIMRe1mKI/AAAAAAAAALw/wL0JhSDPaGk/s1600/screenshot_063.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="76" src="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIMRe1mKI/AAAAAAAAALw/wL0JhSDPaGk/s320/screenshot_063.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And there's a huge dependency list:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIaV25I-I/AAAAAAAAAL4/ihuCjSJb1Rc/s1600/screenshot_062.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIaV25I-I/AAAAAAAAAL4/ihuCjSJb1Rc/s320/screenshot_062.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Went to KPackageKit to get the development version which installed correctly...&lt;br /&gt;&lt;br /&gt;But it still failed in RMagick installation because it (RMagick) needed a later version (I had 6.5.4 and Rmagick 12.13.1 wanted 6.5.9)&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIyYOFL6I/AAAAAAAAAMA/1LJ138nD-3Q/s1600/screenshot_064.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="275" src="http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIyYOFL6I/AAAAAAAAAMA/1LJ138nD-3Q/s320/screenshot_064.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Went to the ImageMagick home page and downloaded and installed their latest version (6.6.1-7) and that installed correctly...&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;But now when trying to run the ImageMagick convert program (as a quick test), I got another error message:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; "error while loading shared libraries: libMagickCore.so.3: cannot open shared object file: No such file or directory"&lt;/div&gt;&lt;br /&gt;Here's the key to getting ImageMagick to finally run... which I finally stumbled upon at &lt;a href="http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&amp;amp;t=15702"&gt;http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&amp;amp;t=15702&lt;/a&gt; after getting that error message. Put the following two lines in your .brashrc (or equivalent) and now it works... Obviously something to do with default paths and where ImageMagic was installed.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; export LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; export LD_LIBRARY_PATH="/usr/local/lib"&lt;br /&gt;&lt;br /&gt;Hopefully, some of these pointers will help someone.&lt;br /&gt;&lt;br /&gt;Unbelievable...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-7657574390838576607?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/7657574390838576607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/05/rmagick-finally-installed-on-kubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7657574390838576607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7657574390838576607'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/05/rmagick-finally-installed-on-kubuntu.html' title='RMagick (finally) installed on Kubuntu...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_BRhkpMuOk1g/S-YIMRe1mKI/AAAAAAAAALw/wL0JhSDPaGk/s72-c/screenshot_063.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-1570846085701488069</id><published>2010-04-29T17:35:00.000-07:00</published><updated>2010-04-29T17:35:00.672-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='git commit message'/><title type='text'>Changing erroneous git commit message...</title><content type='html'>Just the other day, I was making a few small changes to my new site and noticed -- just before I pushed them to github -- that I had created a bad commit message: somehow I had copied the text from the previous commit. Not Good.  I figured that would be easy to change and -- while it turned out to be quite easy -- it wasn't easy to find how to do it. Googling under various phrases kept getting me things like:&lt;br /&gt;&lt;br /&gt;"...just use git rebase -i and 'edit' the commit."  While that's quite true, unless you really get git, it's like the old &lt;a href="http://www.bastichlabz.org/%7Etigger/TechHumor/mshelicopter.txt"&gt;Microsoft helicopter joke&lt;/a&gt;. (I suppose if I really read through the excellent &lt;a href="http://git-scm.com/documentation"&gt;documentation provided for git&lt;/a&gt;, I would have been able to figure it out, but that's a lot of reading for a quick fix.)&lt;br /&gt;&lt;br /&gt;I finally had some help from my friend &lt;a href="http://www.rubyfocus.biz/connection"&gt;Wolf Arnold&lt;/a&gt; and with a little bit of trial and error, I was able to modify my commit message and then push my 3 commits to github.  Here's how to do it. NOTE: This procedure only works if you have not pushed your commits. Once pushed, the commit message is inviolable - by design - as far as I can tell.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;First, make sure you know which commit you want to change. I used &lt;a href="http://sitaramc.github.com/1-basic-usage/gitk.html"&gt;gitk&lt;/a&gt; (for Linux; &lt;a href="http://git-scm.com/documentation"&gt;gitx&lt;/a&gt; on the Mac), which gives you a visual display of your commits and the status of the remotes you are pushing to. Find the relative position of the commit you want to change. In my case, it was the 2nd on the list -- that is, one down from the top.&lt;/li&gt;&lt;li&gt;In your root project directory (where you normally type your "git status" and other commands), type the following:&lt;br /&gt;&lt;pre&gt;git rebase -i HEAD~n&lt;br /&gt;&lt;/n&gt;&lt;/pre&gt;where 'n' is equal to your commit's position on the list, counting from 1 at the top of the list. Notice that the character between HEAD and n is the "twiddle" character or "tilde".&lt;/n&gt;&lt;/n&gt;  &lt;/li&gt;&lt;li&gt;Once you enter that command, you are presented with a screen (in your favorite editor) that looks something like this (the numbers following 'pick' are the internal ids for your commits):&lt;br /&gt;&lt;pre&gt;pick &amp;lt;lots of numbers&amp;gt;&lt;br /&gt;pick &amp;lt;lots of different numbers&amp;gt;&lt;br /&gt;# Rebase 9a122e0..9a122e0 onto 9a122e0&lt;br /&gt;#&lt;br /&gt;# Commands:&lt;br /&gt;#&amp;nbsp; p, pick = use commit&lt;br /&gt;#&amp;nbsp; e, edit = use commit, but stop for amending &lt;br /&gt;#&amp;nbsp; s, squash = use commit, but meld into previous commit &lt;br /&gt;# # If you remove a line here THAT COMMIT WILL BE LOST.&lt;br /&gt;# However, if you remove everything, the rebase will be aborted.&lt;br /&gt;#&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;At this point, you can do one of several things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Edit the file and change the word "pick" to "edit" on the top line of the file. That's the commit that you want to change. Save the file and exit the editor. That will set you up to make the changes in your commit.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Delete every line in the file and save/close it. That's equivalent to a No-Op" and will terminate the rebase.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;There are more options, as you can see from the instructions in the file itself, but we'll leave that for another day.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;When the edit finishes, you will receive instructions at the command line.&amp;nbsp; The next step in the process is to run the command:&lt;br /&gt;&lt;pre&gt;git commit --amend&lt;br /&gt;&lt;/pre&gt;and you will again be presented with an edit screen where you can change the commit message (or other things, but I didn't get into that either). Just change the line with the commit message to what you want it to be.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Once that's done and you've saved/closed the file, run the command:&lt;br /&gt;&lt;pre&gt;git rebase --continue&lt;br /&gt;&lt;/pre&gt;and it'll be done. You can use gitk to check things out and then push to whatever remote you're using.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Enjoy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-1570846085701488069?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/1570846085701488069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/changing-erroneous-git-commit-message.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1570846085701488069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1570846085701488069'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/changing-erroneous-git-commit-message.html' title='Changing erroneous git commit message...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-1667273126799840984</id><published>2010-04-27T11:42:00.000-07:00</published><updated>2010-04-27T11:42:42.571-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='secure login error messages'/><category scheme='http://www.blogger.com/atom/ns#' term='Authlogic'/><title type='text'>Authlogic login error messages...</title><content type='html'>I've been using autthlogic to provide login/signup features for my new web application, and I really like it. It provides lots of great features and has a fair number of plugins and tutorials to add functionality. &lt;br /&gt;&lt;br /&gt;A few weeks past, I added a password reset feature. This was quite straight-forward: I just followed the &lt;a href="http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic/"&gt;password-reset tutorial&lt;/a&gt; and was up &amp; running pretty quickly. &lt;br /&gt;&lt;br /&gt;However, when I did some additional testing on the basic authlogic functionality, I noticed that it took a very simplistic approach to providing error messages for login failures: it would report "Invalid email address" or "Invalid password" if either of those fields were in error. This is not good security: an attacker could determine a valid email address and then use it for social engineering to gain further information.&lt;br /&gt;&lt;br /&gt;Support to fix this is already in Authlogic -- it's just not the default behavior. You have to add the following method call to your UserSession class:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class UserSession &lt; Authlogic::Session::Base&lt;/br&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; generalize_credentials_error_messages true&lt;/br&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;More details can be found at: &lt;a href="http://railsapi.com/doc/authlogic-v2.1.3/classes/Authlogic/Session/Password/Config.html#M000178"&gt;http://railsapi.com/doc/authlogic-v2.1.3/classes/Authlogic/Session/Password/Config.html#M000178&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This post is mostly about collecting the various sources of information about Authlogic -- it's such a popular Rails plugin, that there are many search results, some of them dead or not very helpful. I spent almost an hour googling to find the right stuff, and figured I'd post what I found in case it might save someone else some time.&lt;br /&gt;&lt;br /&gt;General github/authlogic documentation page: &lt;a href="http://rdoc.info/projects/binarylogic/authlogic"&gt;http://rdoc.info/projects/binarylogic/authlogic&lt;/a&gt;. The "documentation" link sends you to an &lt;a href="http://rdoc.info/projects/binarylogic/authlogic"&gt;RDoc Info page&lt;/a&gt;: the main page is an overview, and you get more detail by clicking on the 3 buttons in the upper right-hand corner: "Namespace list", "Method list", and "File list".&lt;br /&gt;&lt;br /&gt;More documentation can also be found at: &lt;a href="http://railsapi.com/doc/authlogic-v2.1.3/ "&gt;http://railsapi.com/doc/authlogic-v2.1.3/ &lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;All in all, really good stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-1667273126799840984?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/1667273126799840984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/authlogic-login-error-messages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1667273126799840984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1667273126799840984'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/authlogic-login-error-messages.html' title='Authlogic login error messages...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-2865257258899232573</id><published>2010-04-14T04:40:00.000-07:00</published><updated>2010-04-14T04:40:32.435-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Using PostgreSQL</title><content type='html'>Now that PostgreSQL is installed and running on my Mac, I need to do something useful with it, like create my database and get it migrated through Rails. &amp;nbsp;The terminology and approach is a tad different from MySQL, but after a bit of googling, I found &lt;a href="http://www.postgresql.org/docs/8.4/static/database-roles.html"&gt;this PostgreSQL documentation page&lt;/a&gt; which got me rolling. &lt;a href="http://www.postgresql.org/docs/8.4/static/tutorial-createdb.html"&gt;This page on creating a database&lt;/a&gt; was actually the starting point, because it worked through the various errors which might occur.&lt;br /&gt;&lt;br /&gt;The key difference for me was that the PostgreSQL superuser is called 'postgres', not 'root' as in MySQL. Prior to digging out this piece of information, everything I tried got the following error:&lt;br /&gt;&lt;br /&gt;&lt;pre class="code" style="background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: black; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;createdb: could not connect to database postgres: &lt;br /&gt;FATAL: &amp;nbsp;role "jseidel" does not exist&lt;/pre&gt;&lt;br /&gt;The other thing that was a minor roadblock was getting out of psql (PostgreSQL's interactive SQL command program). The usual MySQL/bash suspects (quit; exit; bye; {Ctrl-C}) didn't work. With psql you either type "\q" or {ctrl-D} and you're out.&lt;br /&gt;&lt;br /&gt;Finally, since I'm using MacPorts, the location of the PostgreSQL files are different than&lt;a href="http://www.postgresql.org/files/documentation/books/aw_pgsql/node175.html"&gt; documented in the PostgreSQL guide&lt;/a&gt;: my files are rooted off&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/opt/local/lib/postgresql84&lt;/span&gt; instead of &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/usr/local/pgsql&lt;/span&gt; as is indicated in that guide.&lt;br /&gt;&lt;br /&gt;Now I'm able to create my database and see if it connects with Rails...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-2865257258899232573?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/2865257258899232573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/using-postgresql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2865257258899232573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2865257258899232573'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/using-postgresql.html' title='Using PostgreSQL'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-4440165039485951531</id><published>2010-04-12T18:24:00.000-07:00</published><updated>2010-04-14T04:53:44.538-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MacOSx'/><title type='text'>Getting PostgreSQL to run on a Mac...</title><content type='html'>&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;So I decided to switch to PostgreSQL from MySQL. First off, it's what's used by default at Heroku, and I'm so far loving Heroku, its great integration with git, and the resulting ease of deployment. Secondly, I'm a tad concerned about what might happen in the future since Oracle now owns MySQL: could be 'interesting'.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Anyway, I'd always heard that installing PostgreSQL was more challenging than installing MySQL: "MySQL put more effort into making things easier for first-time users" is what my friends have told me. But I also heard that PostgreSQL had better and more standard SQL support (for example, support for foreign keys).&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Anyway, with a bit of searching, I finally found&amp;nbsp;&lt;a href="http://wiki.rubyonrails.org/database-support/postgres"&gt;this RubyOnRails page&lt;/a&gt;&amp;nbsp;which seemed to do a great job of laying things out for all 3 platforms. Seemed pretty straight-forward:&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Install the server:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;pre class="code" style="background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: black; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;sudo port install postgresql83-server&lt;/pre&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Start the server:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: large;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="code" style="background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: black; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist&lt;/pre&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Setup the database:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;pre class="code" style="background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: black; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb&lt;br /&gt;sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb&lt;br /&gt;sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'&lt;/pre&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Two problems:&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;It failed installing the database -- complaining that it couldn't find the header file libpq-fe.h.&amp;nbsp;&lt;/li&gt;&lt;li&gt;It installed version 8.3 and version 8.4 is now current.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family: monospace; font-size: 14px; white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: Times; font-size: medium; white-space: normal;"&gt;More searching led me to the MacPorts site which has the required library:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;pre class="code" style="background-color: #f7f9fa; border-bottom-color: rgb(204, 204, 204); border-bottom-style: dashed; border-bottom-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: dashed; border-left-width: 1px; border-right-color: rgb(204, 204, 204); border-right-style: dashed; border-right-width: 1px; border-top-color: rgb(204, 204, 204); border-top-style: dashed; border-top-width: 1px; color: black; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: auto; overflow-y: auto; padding-bottom: 0.5em; padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.5em;"&gt;sudo port install libpqxx&lt;/pre&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;However, it also wound up installing the 8.4 version of PostgreSQL, but version 8.3 still is the one that gets launched... seems to work, but certainly not as clean as I would like.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Given the problems I had in the past before I cleaned my machine and installed Ruby &amp;amp; Rails "from scratch" with MacPorts (see&amp;nbsp;&lt;a href="http://www.nubyrubyrailstales.com/2010/03/macports-headaches-solved.html"&gt;my previous post on this issue)&lt;/a&gt;&amp;nbsp;as I could easily get PostgreSQL with relatively little hassle.&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;So far, so good...&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;PS Check out&amp;nbsp;&lt;a href="http://enterpriserails.chak.org/"&gt;"Enterprise Rails" (Dan Chak, O'Reilly)&lt;/a&gt;. He does a really nice job of discussing Rails' scaling and reliability issues and does it all in the context of PostgreSQL. Good book!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-4440165039485951531?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/4440165039485951531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/getting-postgresql-to-run-on-mac.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4440165039485951531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4440165039485951531'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/04/getting-postgresql-to-run-on-mac.html' title='Getting PostgreSQL to run on a Mac...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-1755300292595544518</id><published>2010-03-22T10:26:00.000-07:00</published><updated>2010-03-22T10:26:17.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='MacOSx'/><title type='text'>MacPorts headaches... solved!</title><content type='html'>So I finally found a way to solve all those MacPorts headaches,  thanks to Erik Michaels-Ober, a friend of a friend. As I and many folks  have learned, Mac OS X is less than standard *Nix when it comes to  setting up their directories, and it doesn't take kindly to co-creation  of a parallel directory tree. MacPorts puts things in the (*Nix)  standard /opt directory, but once that's done, you get path and name  clashes.&lt;br /&gt;&lt;br /&gt;I've seen bits and pieces of a solution as  noted in my previous posts, but they really didn't fix the problem. And  of course, there's the issue that's been reported elsewhere that  upgrading to Snow Leopard can wreak havoc on a development setup.&lt;br /&gt;&lt;br /&gt;So  following Eriks' instructions, here's what I did:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I wiped my  system clean and installed Snow Leopard from scratch. You may be able  to just do an upgrade, but I chose to go with a clean system.&lt;/li&gt;&lt;li&gt; Install the XCode Developer Tools that come with Snow Leopard (or   download the latest version from the Apple website. Warning: it’s a big   file).&lt;/li&gt;&lt;li&gt;Remove all the pre-installed rubygems from your system.  You can do  this  using the “gem uninstall” command, or brute force. I chose the  brute force method, but only after creating a copy before I did the  deletion, just in case. Once I knew it worked, I got rid of my copies.&lt;code&gt;&lt;br /&gt;rm -rf   /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/*&lt;/code&gt;&lt;br /&gt;&lt;code&gt;rm -rf /Library/Ruby/Gems/1.8/*&lt;/code&gt;&lt;/li&gt;&lt;li&gt; Install MacPorts (see the &lt;a href="http://www.macports.org/install.php"&gt;MacPorts installation page&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;Make sure you’re running MacPorts version 1.8.2 (type: &lt;code&gt;port  version&lt;/code&gt;).  If not, run the command: &lt;br /&gt;&lt;code&gt;sudo port selfupdate&lt;/code&gt;&lt;/li&gt;&lt;li&gt; Install the MacPorts version of ruby itself:&lt;br /&gt;&lt;code&gt;sudo port install ruby&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install the MacPorts version of rubygems:&lt;br /&gt;&lt;code&gt;sudo port install rb-rubygems&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install the MacPorts version of git:&lt;br /&gt;&lt;code&gt;sudo port install git-core&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Upgrade to the latest version of rubygems:&lt;br /&gt;&lt;code&gt;sudo gem update --system&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Make sure you’re running rubygems version 1.3.5 (type: &lt;code&gt;gem -v&lt;/code&gt;).   If not, run the command: &lt;code&gt;update_rubygems&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Install all the gems you want (rails, heroku, etc.).  They will be  installed into /opt/local/lib/ruby/gems/&lt;/li&gt;&lt;/ol&gt;I set up my machine about a month ago and it's been working  fine ever since.&lt;br /&gt;&lt;br /&gt;Enjoy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-1755300292595544518?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/1755300292595544518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2010/03/macports-headaches-solved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1755300292595544518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/1755300292595544518'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2010/03/macports-headaches-solved.html' title='MacPorts headaches... solved!'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-6020202202898822098</id><published>2009-10-26T14:30:00.000-07:00</published><updated>2009-10-26T14:30:08.363-07:00</updated><title type='text'>MacPorts headaches... follow-up</title><content type='html'>Some of these issues apparently have to do with the order in which things are done and may also depend on the fact that some of these packages require native C-language extensions.&lt;br /&gt;&lt;br /&gt;I wanted to work with nokogiri to do some XML parsing. Given my previous post, I figured I'd better install this using MacPorts, which I did:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sudo port install nokogiri&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;That was pretty straight-forward and worked quickly. However, when I went to irb to check things out, I got the following message:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;irb(main):001:0&amp;gt; require 'nokogiri'&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;HI. &amp;nbsp;You're using libxml2 version 2.6.16 which is over 4 years old and  has&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;plenty of bugs. &amp;nbsp;We suggest that for maximum HTML/XML parsing pleasure,  you&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;upgrade your version of libxml2 and re-install nokogiri. &amp;nbsp;If you like  using&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;libxml2 version 2.6.16, but don't like this warning, please define the  constant&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring  nokogiri.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;So I quit irb and installed libxml2&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; sudo port install libxml2 &lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;div&gt;which also went just fine.&amp;nbsp; Unfortunately, nokogiri still gave me that long warning message.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What I had to do was re-install nokogiri so that it would recognize the new version of libxml2 (which was now in the /opt/local tree) and then everything worked fine.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Seems like I can get things to work now, but having to remember previous dependencies and re-install packages to pick up those new items isn't going to be fun.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-6020202202898822098?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/6020202202898822098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/10/macports-headaches-follow-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/6020202202898822098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/6020202202898822098'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/10/macports-headaches-follow-up.html' title='MacPorts headaches... follow-up'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-7865104051581924245</id><published>2009-10-26T12:45:00.000-07:00</published><updated>2010-04-27T11:11:15.897-07:00</updated><title type='text'>MacPorts headaches...</title><content type='html'>Recently I started doing some of my development work on a little MacBook. Pretty nice as I drop down into terminal, have all the power of *nix (FreeBSD-based in this case), and still have Mac niceties available to me, such as MacVim for editing.&lt;br /&gt;&lt;br /&gt;Everything is rocking along just fine: I've got Cucumber and RSpec running and working my way thru &lt;a href="http://pragprog.com/titles/achbd/the-rspec-book"&gt;"The RSpec Book"&lt;/a&gt; (pretty useful so far). However, I needed to install FXruby so that I could do some graphical work and figured this would be no problem. Turned out to be a little tricky and I had to remember an issue I ran into a while back on a Linux system.&lt;br /&gt;&lt;br /&gt;First off, this won't work:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gem install fxruby&lt;br /&gt;&lt;/div&gt;It'll install that gem alright, but that's not enough to get things running: you have to get Fox installed as well and that doesn't come along with the gem.&lt;br /&gt;&lt;br /&gt;Of course, to do that, you have to install MacPorts which is actually relatively painless (see the &lt;a href="http://guide.macports.org/#installing.macports"&gt;MacPorts Guide&lt;/a&gt; for how to do this).&lt;br /&gt;&lt;br /&gt;Once you've done this, then you can install the complete FXRuby collection of stuff (see the &lt;a href="http://pragprog.com/titles/fxruby/fxruby"&gt;FXRuby Book&lt;/a&gt; at PragProg.com)... &lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sudo port install rb-fxruby&lt;br /&gt;&lt;/div&gt;and it's a very large collection indeed: it took over 1 hour on my machine.&lt;br /&gt;&lt;br /&gt;The only hitch I ran into was having too old a version of the Mac XTools package, so that was another 800Megs of download and an install. If you do this make sure you get the right version: XTools 3.1 is for OS X 10.5 and XTools 3.2 is for 10.6. Check this first or you'll spend most of an hour installing fxruby only to have it complain about the wrong XTools version and you'll have to start over.&lt;br /&gt;&lt;br /&gt;MacPorts updates your ~/.profile or ~/.bash_profile file (note that the MacPorts install docs only mention ~/.profile and I had to dig a bit to find that they had properly modified my ~/.bash_profile file) so that your system can find the added programs...&lt;br /&gt;&lt;br /&gt;But that's not quite everything you have to do and here was the gotcha for me. Even after I went through all this, I kept getting strange messages out of my test runs, things like:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; "unable to load file ubygems"&lt;br /&gt;&lt;/div&gt;(the missing 'r' is not a typo: that was the exact error message) when executing the "require 'rubygems'" statement.&lt;br /&gt;&lt;br /&gt;I tried adding the command:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; export RUBYOPT=rubygems&lt;br /&gt;&lt;/div&gt;to my profile so that I wouldn't have to add a require 'rubygems' statement but that didn't solve the problem.&lt;br /&gt;&lt;br /&gt;BTW, when I went to the &lt;a href="http://docs.rubygems.org/read/chapter/3"&gt;RubyGems Guide&lt;/a&gt;, they said to use the -rubygems option on the ruby command line, but that also generated the same error.&lt;br /&gt;&lt;br /&gt;After a little more digging, I found the problem: MacPorts installs everything in /opt/local, which is not where the normal gem command installs things (if you do a simple "gem install &lt;gem&gt;' they wind up in /usr/bin).&amp;nbsp; Thus, after MacPorts was installed, ruby got a tad confused and couldn't find everything it needed.&amp;nbsp; Then I remembered what I had run into when I was working on my Linux box: trying to install a LAMP stack: everything got put into /opt/local, but then it was out of the normal stream of things and there were ongoing problems. I finally bit the bullet in that case, removed the LAMP stack, and manually installed everything into their default locations. Life has been pretty good in Linux-land ever since.&lt;/gem&gt;&lt;br /&gt;&lt;br /&gt;The solution? Install rubygems using MacPorts so that my FXRuby could find what it needed. That was a simple:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sudo port install rb-rubygems&lt;br /&gt;&lt;/div&gt;and now my ruby apps would run again, load the gems, and I had a simple FXRuby app running.&lt;br /&gt;&lt;br /&gt;Quite frankly, I'm not sure of all the nitty-gritty details of this problem and I'm not even sure that I won't have further problems downstream when I want to use another gem, but I'll face that problem when I come to it. If anyone has a definitive answer as to WHY this happened and a better approach to Mac OS X gem&amp;nbsp; installation, I'm all ears.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-7865104051581924245?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/7865104051581924245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/10/macports-headaches.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7865104051581924245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7865104051581924245'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/10/macports-headaches.html' title='MacPorts headaches...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-3343450442912962634</id><published>2009-09-07T12:27:00.000-07:00</published><updated>2009-09-07T12:28:35.512-07:00</updated><title type='text'>A Users Guide is a great developer tool...</title><content type='html'>Today I was reminded just how important documentation is, particularly End-User documentation... you know, the instructions for how folks are actually going to use your system.&lt;br /&gt;&lt;br /&gt;In my spare time, I've been developing a very small system for a client (unfortunately not in Ruby/Rails, but that's another story). It's designed to replace one labor-intensive portion of their Commission calculation process, which is spreadsheet-intensive. You've seen them before: someone develops a simple spreadsheet to "save time" and eventually, the spreadsheet is a monster and the whole process takes days to complete and is fraught with potential errors. And with the sales reps watching the numbers like a hawk, &lt;i&gt;&lt;u&gt;nothing&lt;/u&gt;&lt;/i&gt; slips by.&lt;br /&gt;&lt;br /&gt;The piece I'm replacing is for maintaining the Work In Process costs and pricing factors for the products developed&amp;nbsp; in-house. It's a tiny database application which outputs an Excel workbook that is dropped into the monster spreadsheet and thereby replaces a very time-consuming manual update process. In fact, the process has been so challenging in the past that cost updates have been few and far between. The new system will allow them to make pricing changes at will.&lt;br /&gt;&lt;br /&gt;Over the past few weeks, time permitting, I've developed small pieces of the system and run it by the client to make sure that my understanding is correct, and they've approved the prototype pieces that I've provided to them. This is actually part of my proposal process: try out important pieces of the system, and then let the client approve the results.&lt;br /&gt;&lt;br /&gt;Today, I started writing the contract for the actual development. As part of the scope of work, I provided screen shots and a high-level overview of the procedural steps for using the system. As I worked through the steps in the workflow, I suddently realized that I was omitting one piece! I had prototyped that portion of the system early on and it worked OK, but the table I had created was only a dummy table, hand-crafted for testing, and I had not provided the necessary support for a user to maintain that table!&lt;br /&gt;&lt;br /&gt;Fortunately I found this out before completing development and installing it for my client. At this stage in the game, it was pretty easy to add the required functionality and include it in the Users Guide.&lt;br /&gt;&lt;br /&gt;You can call it what you want: Requirements or Design or Testing. Developing a Users Guide can help in all areas of your application life cycle methodology. In this case, I&amp;nbsp; like to think of the Users Guide as being a form of UI Testing: I used it to test my prototype design (screenshots, data entry forms, reports, and output files) against the user interaction that would be required to &lt;u&gt;&lt;i&gt;actually do something productive&lt;/i&gt;&lt;/u&gt; with the system.&lt;br /&gt;&lt;br /&gt;Does this apply to Rails? You bet! Just watch &lt;a href="http://scotland-on-rails.s3.amazonaws.com/1A06_JosephWilk-SOR.mp4"&gt;Jospeh Wilk's Cucumber presentation at Scotland on Rails 2009&lt;/a&gt;. He suggests that you "...think about the user interface first " and asks "...how is the business user going to achieve value through the interface?" He also stresses figuring out what's really important to you and to your user (see his example of "Popping the Why Stack"). I particularly like his question: "Have we achieved what the user wants yet?" It's all about a single-minded focus on the user of the system and the value that the system is to provide. &lt;br /&gt;&lt;br /&gt;Fortunately my Users Guide test failed and I was able to address the issue today, not later down the road when it would be more time-consuming. And I saved a potentially awkward situation with my client.&lt;br /&gt;&lt;br /&gt;So... I'm going to be more careful about writing Users Guides and testing the user workflow in the future...&lt;br /&gt;&lt;br /&gt;When do you write your Users Guide?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-3343450442912962634?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/3343450442912962634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/09/users-guide-is-great-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3343450442912962634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3343450442912962634'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/09/users-guide-is-great-tool.html' title='A Users Guide is a great developer tool...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-3657622647646796848</id><published>2009-08-28T15:58:00.000-07:00</published><updated>2009-08-28T16:20:03.024-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rails upgrade'/><category scheme='http://www.blogger.com/atom/ns#' term='migrations'/><category scheme='http://www.blogger.com/atom/ns#' term='sessions'/><title type='text'>Snipping the blight... fantastic!</title><content type='html'>I've been fighting an elusive bug for the past few weeks: I've developed some major enhancements for &lt;a href="http://www.4mypasswords.com/"&gt;my passwords site&lt;/a&gt; plus upgrading to more recent versions of Rails and associated plugins (improved security and testability being my primary goal).&amp;nbsp; Things were going along fine until I deployed my app to production: I was able to login without errors, but was then immediately returned to the login screen. Needless to say, the &lt;a href="http://www.capify.org/index.php/Capistrano"&gt;Capistrano&lt;/a&gt; deploy:rollback task was just what the doctor ordered (that's why I love Cap: it took a bit to get it setup originally, but it really makes deploying or undeploying applications a snap - if you have an app in production and you don't have Capistrano or something similar, do it now).&lt;br /&gt;&lt;br /&gt;Anyway, I setup up a production environment on my development machine and, sure enough, it failed in production mode but ran fine in development mode. I modified the production settings so that I would get error messages [Note to self: put it back like it was!] and got a message saying that a module in the filter chain had returned false... it looked as if it were failing authentication somewhere in the login system.&lt;br /&gt;&lt;br /&gt;I started digging into the code and using the debugger to see what was going on: from the symptoms and the error message, it seemed to be a problem with session state. Checking with my hosting tech support and local Rails folks, I learned there were reports of problems with sessions in Rails 2.3.2 and one of the local chaps, &lt;a href="http://darkindigo.com/"&gt;Brendon Whateley&lt;/a&gt;, reported some serious session issues that he had and chased the code back to Rails initialization and lots of 'magic' aliasing and overriding of ActiveRecord methods (nice stuff when it works). To quote:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: x-small;"&gt;"Having spent the best part of a week debugging the sudden failure of sessions recently, I may be able to help.&amp;nbsp; The first thing to figure out is if the session is saving state and not loading, or loading but not saving.&amp;nbsp; In my case the ActiveRecordStore was not serializing the session data, but was loading and saving the session object.&amp;nbsp; This meant that previously set session values still existed, but any changes did not persist across calls.&amp;nbsp; I was able to validate that the logins were successful, but suffered similar issues to you.&lt;br /&gt;&lt;br /&gt;"In the end I tracked the problem down to overriding the ActiveRecord::Base.create_or_update method.&amp;nbsp; For some reason it completely broke ActiveSessionStore serialization, even if the redefined method contained the exact same code as the original.&amp;nbsp; I never completely figured out WHY that broke, but if I moved my changes to create and update methods that create_or_update called, I no longer experienced that problem."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Made sense to me, and since I am using some of the ActiveRecord callbacks, it seemed quite reasonable. So off I went, digging thru my code, researching how the callbacks were used, trying to find out if anyone else was using them, more debugging... all of which went nowhere.&lt;br /&gt;&lt;br /&gt;Yesterday, I bit the bullet and upgraded to Rails 2.3.3. Very easy; just do&lt;br /&gt;&lt;pre&gt;&amp;nbsp;&amp;nbsp;gem install rails &lt;/pre&gt;and try it again in production mode.&lt;br /&gt;&lt;br /&gt;You can imagine my surprise when all of a sudden, the app crashed and emitted the following error messge:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;ActiveRecord::StatementInvalid (Mysql::Error: Unknown column &lt;br /&gt;'assets.type_id' in 'on clause': SELECT count(DISTINCT `assets`.id) AS &lt;br /&gt;count_all FROM `assets`&amp;nbsp; LEFT OUTER JOIN `types` ON `types`.id = &lt;br /&gt;`assets`.type_id WHERE ((user_id = 1 and ( entry like '%' or entry &lt;br /&gt;like '%' ))) ):&lt;br /&gt;&amp;nbsp; -e:2:in `load'&lt;br /&gt;&amp;nbsp; -e:2&lt;/pre&gt;I had never received any such error message in Rails 2.3.2 (obviously some kind of bug there which caused this to appear as if it were a filter chain termination), but this made it clear what had happened. In the process of upgrading from Rails 1.x to 2.x, I had experimented with using some database constraint logic. It had been a tad problematic and I wanted to focus on the Rails upgrade so I removed those migrations. It was probably at that point that the development database and the production database got out of sync (I haven't yet gone back to my subversion repository to see exactly what/when it happened, but I may do that yet out of curiosity).&amp;nbsp; I had added a new "type_id" field that was required to support the new version of &lt;a href="http://activescaffold.com/"&gt;ActiveScaffold&lt;/a&gt; and it had never been added to the production database, even though the schemo_info table contained the same information in both databases (I know, because I checked before I started the whole deploy process).&lt;br /&gt;&lt;br /&gt;So what did I learn from this?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Even though there were several other folks looking at this, we all missed the obvious: development and production mode are different not only in the code base but also in the database. I&amp;nbsp; suffered from a &lt;a href="http://en.wiktionary.org/wiki/perceptual_set"&gt;perceptual set&lt;/a&gt; when identifying potential sources of the problem (and &lt;a href="http://nubyrubyrailstales.blogspot.com/2009/08/pair-programming-really-works.html"&gt;Paired Programming&lt;/a&gt; isn't always a silver bullet). In the future, I'm going to be a little more diligent when exploring potential solution spaces.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Rails migrations, while very nice, are also fragile. I've had problems with them in the past: simply checking that the schema_info values are the same just isn't always enough. I'm going to add migrations and database state to my checklist of things to review before deployments or when making changes. &lt;/li&gt;&lt;li&gt;Rails migrations, while very nice, are also something of a siren song, luring one into complacency about the database. "When they are good they are very, very good, and when they are bad they are horrid." After a long period of no problems, I had assumed (mistake!) that they were under control: in a way, I thought of them as if they were "source code control" for my database. They are not, and I'm going to pay more attention to that in the future.&lt;/li&gt;&lt;li&gt;Rails upgrades are in the same category: they can be remarkably easy, such as my switch from 2.3.2 to 2.3.3 or they can be remarkably messy, as has been my switch from 1.3.6 to 2.3.3. On the one hand, I want to stick with a known version: there are just too many changes that I view as frivolous in the Rails code base to want to go through all the deprecations and just plan different stuff unless it's really necesary. At the same time, we do need to stay reasonably up-to-date to take advantage of the definite improvements such as better plugins and greater security. This is an individual decision, based on your particular requirements. Regardless, YMMV.&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;So... one more bug snipped out of my app and that much closer to deployment. Some cleanup and more testing and it should be good to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-3657622647646796848?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/3657622647646796848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/snipping-blight-fantastic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3657622647646796848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3657622647646796848'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/snipping-blight-fantastic.html' title='Snipping the blight... fantastic!'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-8172620145878924667</id><published>2009-08-26T08:41:00.000-07:00</published><updated>2009-08-26T09:08:28.968-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='rspec'/><category scheme='http://www.blogger.com/atom/ns#' term='cucumber'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='bdd'/><title type='text'>Learning RSpec/Cucumber - Day 1</title><content type='html'>I've wanted to improve my testing for some time now and so I'm pairing on the RSpec book with my friend, &lt;a href="http://workingwithdata.com"&gt;Allan Miller&lt;/a&gt;. We're going to work through the book/examples in tandem and get together regularly to review what we've learned.  We just downloaded &lt;a href="http://pragprog.com/titles/achbd/the-rspec-book"&gt;the RSpec book by Pragmatic&lt;/a&gt; and assigned Chapters 1-3 (this is the book that was highly recommended by our&lt;a href="http://ruby.meetup.com/81"&gt; Ruby Meetup&lt;/a&gt; folks). We'll work through this and then meet in a couple of days to see how things went and move on to the next group of chapters. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For now, I'm running all this on my MacBook, without any IDE... just straight terminal access and MacVIM. Chapters 1 &amp;amp; 2 are introduction; chapter 3 is where you start actually doing stuff.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First problem (minor) that I ran into was that the rspec installation wasn't clean; I got the following errors:&lt;/div&gt;&lt;div&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica; min-height: 13.0px"&gt;&lt;span style="letter-spacing: 0.0px"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Successfully installed rspec-1.2.8&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;1 gem installed&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Installing ri documentation for rspec-1.2.8...&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Installing RDoc documentation for rspec-1.2.8...&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Could not find main page README.rdoc&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Could not find main page README.rdoc&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Could not find main page README.rdoc&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Could not find main page README.rdoc&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;So far, this doesn't seem to have affected anything -- I just ignored it and moved on (so far, I don't use the ri or RDoc information at all).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The cucumber installation was a little more disconcerting:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;Installing ri documentation for builder-2.1.2...&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;ERROR:  While generating documentation for builder-2.1.2&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;... MESSAGE:   Unhandled special: Special: type=17, text="&lt;!-- HI --&gt;"&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;... RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;span style="letter-spacing: 0.0px"&gt;(continuing with the rest of the installation)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Courier New"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;but again, it was only documentation so I moved on from here as well (have to pick your battles, you know).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everything went just fine, except for a couple of glitches: one was just some missing default snippets and the other was a result of those missing snippets. Here's what happened:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;The first attempt at cucumber did NOT display the snippets for the 3 undefined steps (pp 27-28 in my beta copy of the book) as expected. Rather than being able to copy and modify them I had to type them in by hand. [I tried the command twice just to make sure.. sure enough, didn’t display, although a later point where I had only one step undefined, it DID display the snippet template. Go figure.]&lt;/li&gt;&lt;li&gt;Because of #1, I made a transcription error in the regexp for step 3: I omitted the ‘^’ exclusion character. This cost me several minutes (regexp’s are like that!).  I have a feeling that there may be more of these... hopefully I’ll be able to get the step snippets more reliably in the future and then just copy them into my step definitions as a starting point.&lt;/li&gt;&lt;/ol&gt;All in all, a successful beginning... But I do have a concern -- given that we're using regexp's, there are MANY opportunities for small errors that can cost time. Seems like a bit of a contradiction: cucumber is a "higher level" testing language than rspec, but it uses one of the lowest level syntaxes to accomplish this. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'll just have to wait and see what this leads to... and I'm sure going to copy/paste those snippets whenever I can.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-8172620145878924667?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/8172620145878924667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/learning-rspeccucumber-day-1.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/8172620145878924667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/8172620145878924667'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/learning-rspeccucumber-day-1.html' title='Learning RSpec/Cucumber - Day 1'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-4390546988354031547</id><published>2009-08-26T06:32:00.000-07:00</published><updated>2009-08-26T06:54:19.226-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ActiveScaffold'/><category scheme='http://www.blogger.com/atom/ns#' term='pair programming'/><category scheme='http://www.blogger.com/atom/ns#' term='debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='AjaxUpdater'/><title type='text'>Pair programming really works!</title><content type='html'>I've known this in the past and I had another "Aha!" moment the other day: pair programming (or debugging in this case) is great!&lt;br /&gt;&lt;br /&gt;I've had a problem for  the past week or so in one of my applications. I'm in the middle of a big upgrade (from Rails 1.3.6 to Rails 2.3.2 and lots of other associated changes), when I hit a hard stop; my screen wasn't getting updated correctly after an Ajax call.&lt;br /&gt;&lt;br /&gt;I struggled with this for quite some time and then today called &lt;a href="http://www.workingwithdata.com/"&gt;Allan Miller&lt;/a&gt;, a good friend of mine over to help me debug it. He sat down, I described he problem and demonstrated it. He said "Well, let's take a look and make sure that you're actually getting an XHR request." so we fired up FireBug and entered a couple of trials: the POST request was properly executed and my application did see it as an XHR request. Everything's working as exepcted so far, but no errors and no screen refresh.&lt;br /&gt;&lt;br /&gt;Since he had been focusing on the Ajax call, I decided to show him the code on the page, and used FireBug's feature to "click an element to inspect" and pointed out the code [line breaks inserted for readability; this is all one line of code]:&lt;br /&gt;&lt;pre&gt;&amp;lt;a class="ltr-locate" onclick="new Ajax.Updater('asset-content', '/asset/get_assets?ltr=F',&lt;br /&gt;{asynchronous:false, evalScripts:true, parameters:'authenticity_token=&lt;br /&gt;' + encodeURIComponent('xxx')}); return false;" href="/asset/get_assets" align="right"&amp;gt;F&amp;lt;/a&amp;gt;&lt;/pre&gt;&lt;br /&gt;"See" I said. "There's the AjaxUpdater call to update the... ... that's it!" The first field in the AjaxUpdater call signifies the named area on the page that will be updated as a result of the call. In this case 'asset-content'. "I'll bet that they changed the name in the intervening releases" I said.&lt;br /&gt;&lt;br /&gt;Sure enough, that was the case: the name name is 'as_asset-content' and updating the link_to_remote call solved the problem. What a relief!&lt;br /&gt;&lt;br /&gt;I've got 3 take-aways from this:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Two heads are at least 10 times better than 1, if you compare 50 total minutes of work (25 minutes times 2 heads) with at least 10 hours of work with my one head. There's just something magical about having to REALLY explain your code to an outside observer that makes you think thru things much more carefully. It's making the thinking process external, rather than internal where your hidden assumptions come into play without your even knowing it.&lt;/li&gt;&lt;li&gt;The AjaxUpdater call gives NO ERROR if the named area doesn't exist; it just quietly closes up shop, assuming that you knew what you were doing.&lt;/li&gt;&lt;li&gt;I was reminded how great FireBug is for this kind of thing. Quick and easy to see that the Ajax call was firing with the right information so that we could move on to the next question.&lt;/li&gt;&lt;/ol&gt;Extrapolating that out, I would imagine that -- had there beeen two folks in the seat from the beginning -- this whole thing wouldn't have taken so long... and the code would probably be better for it.&lt;br /&gt;&lt;br /&gt;Reminds me of the old "Double your pleasure..." chewing gum ad, only in this case it's really true.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-4390546988354031547?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/4390546988354031547/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/pair-programming-really-works.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4390546988354031547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/4390546988354031547'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/pair-programming-really-works.html' title='Pair programming really works!'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-5089642131767329244</id><published>2009-08-19T11:48:00.000-07:00</published><updated>2009-08-26T11:54:24.281-07:00</updated><title type='text'>Interesting svn "gotcha"... II</title><content type='html'>Turns out, there's any easy fix for this situation (see&lt;a href="http://nubyrubyrailstales.blogspot.com/2009/08/interesting-svn-gotcha.html"&gt; Interesting svn 'gotcha'&lt;/a&gt;). All you have to do is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Checkout your entire project into a different directory using your command line client.&lt;/li&gt;&lt;li&gt;Run the script/plugin install... command on that working copy.&lt;/li&gt;&lt;li&gt;Checkin the updates you just made.&lt;/li&gt;&lt;li&gt;Update the IDE working copy to the latest from repository.&lt;/li&gt;&lt;/ol&gt;Easy; problem solved...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-5089642131767329244?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/5089642131767329244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/interesting-svn-gotcha-ii.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5089642131767329244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5089642131767329244'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/interesting-svn-gotcha-ii.html' title='Interesting svn &quot;gotcha&quot;... II'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-7076446320657012050</id><published>2009-08-17T16:31:00.000-07:00</published><updated>2009-08-17T17:25:46.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='subversion client'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Aptana'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux installation'/><title type='text'>Interesting svn "gotcha"...</title><content type='html'>I just learned that you have to be careful about which version of subversion you are using if you have an IDE and also want to use the command-line client.&lt;br /&gt;&lt;br /&gt;Starting about V1.4, there were changes in the internal structure of the subversion directory hierarchy (i.e., the .svn files that it creates to track things) which means that you have to make sure that your versions are in synch.&lt;br /&gt;&lt;br /&gt;For example, I'm using &lt;a href="http://aptana.com/"&gt;Aptana Studio&lt;/a&gt;, which is eclipse-based, and which uses the latest subclipse client (&lt;a href="http://subclipse.tigris.org/"&gt;subversion for Eclipse&lt;/a&gt;). That latest version is V1.6. However, on my Kubuntu development box (V8.04/Hardy Heron), the latest subversion package right now is V1.4. If I try to run a subversion command from the shell, I get this error message:&lt;br /&gt;&lt;blockquote&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;jseidel@EDP15:~/AptanaStudio/4MyPasswords$ svn status&lt;br /&gt;svn: This client is too old to work with working copy '.'. You need&lt;br /&gt;to get a newer Subversion client, or to downgrade this working copy.&lt;br /&gt;See &lt;a href="http://subversion.tigris.org/faq.html#working-copy-format-change"&gt;http://subversion.tigris.org/faq.html#working-copy-format-change&lt;/a&gt;&lt;br /&gt;for details.&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;The help link above will explain that -- due to new features in the later versions -- they had to introduce new structure which is incompatible with the older clients.&lt;br /&gt;&lt;br /&gt;Since I don't want to downgrade my working copy, I went looking for V1.6 command-line clients. Sad to say, they aren't packaged (yet) for Kubuntu/Hardy --so far I only found it for the &lt;a href="https://launchpad.net/ubuntu/+source/subversion"&gt;Karmic version of Ubuntu&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are other svn clients out there, either as wrappers around the command line client, or full-on clients. One that I looked at was &lt;a href="http://kdesvn.alwins-world.de/"&gt;kdesvn&lt;/a&gt;. This looked to be a nice client and was at V1.6. Unfortunately, the developer only provides a Fedora package, so I would have to build my own from source.&lt;br /&gt;&lt;br /&gt;I went to the &lt;a href="http://subversion.tigris.org/"&gt;subversion site&lt;/a&gt;, but the referenced Ubuntu binaries only pointed back to the Ubuntu site and the older version, so I tried building it from source. Bad move! As stated on their site, there are a number of dependencies which I started to work through one at a time. When I reached a point of having to figure this out:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;jseidel@EDP15:~/downloads/subversion-1.6.4/subversion-1.6.4$ apr/buildconf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: checking installation...&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: autoconf version 2.61 (ok)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: autoheader version 2.61 (ok)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: libtool version 1.5.26 (ok)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: local copy of find_apr.m4 does not match APR's copy.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;            An updated copy of find_apr.m4 may need to be checked in.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildcheck: local copy of PrintPath does not match APR's copy.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;           An updated copy of PrintPath may need to be checked in.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Copying libtool helper files ...&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;buildconf: Using libtool.m4 at /usr/share/aclocal/libtool.m4.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Creating include/arch/unix/apr_private.h.in ...&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Creating configure ...&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;configure.ac:185: error: possibly undefined macro: AC_PROG_LIBTOOL&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;      If this token and others are legitimate, please use m4_pattern_allow.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;      See the Autoconf documentation.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Generating 'make' outputs ...&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;apr/buildconf: 91: build/gen-build.py: not found rebuilding rpm spec file&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;apr/buildconf: 107: build/get-version.sh: not found&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cat: ./build/rpm/apr.spec.in: No such file or directory&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;I quit trying: I want to work on my application, not have to learn THIS much about the internals of the tool I want to use... Argh! For now, I'm sticking with the Aptana support which is working (with some help from the Aptana support folks), although I do miss the ability to do quick svn commands from the shell.&lt;br /&gt;&lt;br /&gt;I think Linux needs to come up with a better installation mechanism...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-7076446320657012050?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/7076446320657012050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/interesting-svn-gotcha.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7076446320657012050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/7076446320657012050'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2009/08/interesting-svn-gotcha.html' title='Interesting svn &quot;gotcha&quot;...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-8322418962763833728</id><published>2008-04-16T17:12:00.000-07:00</published><updated>2008-04-16T17:19:05.890-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='capistrano pty deploy'/><title type='text'>Capistrano now needs a pseudo-tty...</title><content type='html'>&lt;p&gt;I've been using Capistrano 2.x for sometime now and really like it but ran into a strange problem a couple of days ago when attempting to deploy a new version of my website.&lt;/p&gt;&lt;p&gt;I had last deployed in March of this year with no problems. Since that time I had made no changes to Capistrano (no upgrades, tweaks, etc.), but on this deploy, it failed miserably. The only indicator were numerous messages saying:&lt;/p&gt;&lt;blockquote&gt;  ** [err] stdin: is not a tty&lt;/blockquote&gt;&lt;p&gt;Sometimes it caused the command to abort and sometimes it didn't.&lt;/p&gt;&lt;p&gt;The solution was hard to find but easy to implement. Just add the following to your deploy.rb:&lt;/p&gt;&lt;blockquote&gt;default_run_options[:pty] = true&lt;/blockquote&gt;&lt;p&gt;Apparently, versions up until Cap 2.1 would always allocate a pseudo-tty (pty) for every command it ran. However, with the removal of this default in Cap 2.1, "...some commands, in certain environments" fail with no pty [so says my Rails host]. Adding this new option put my deploys back in shape.&lt;/p&gt;&lt;p&gt;I wonder why this got removed in the first place...?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-8322418962763833728?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/8322418962763833728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2008/04/capistrano-now-needs-pseudo-tty.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/8322418962763833728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/8322418962763833728'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2008/04/capistrano-now-needs-pseudo-tty.html' title='Capistrano now needs a pseudo-tty...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-695524907364724001</id><published>2007-07-19T16:41:00.001-07:00</published><updated>2007-07-19T17:04:19.649-07:00</updated><title type='text'>Capistrano on Windows client...</title><content type='html'>It was supposed to be easy: just read the &lt;a href="http://manuals.rubyonrails.org/read/book/17"&gt;Capistrano manual&lt;/a&gt; make a little magic with your deploy.rb file, and you're in business. Sounds wonderful, doesn't it? Would that it were so easy.&lt;br /&gt;&lt;br /&gt;The documentation (manual and elsewhere) makes it clear that Cap'ping to a Windows server is pretty challenging... Cap is made for *nix machines. However, I didn't find anything about a Windows client, other than the statement that "you must have an svn client installed on your machine."  I did -- RapidSVN, TortoiseSVN, and the svn client embedded in the Aptana IDE.&lt;br /&gt;&lt;br /&gt;However, once I got to actually attempting to deploy my application, it failed every time with a "no such file or directory" error message and a reference to the repository trunk itself.  No amount of hair-pulling (it was a VERY long weekend), searching the web, emailing a few contacts helped... not matter what I did, it continued to fail in exactly the same manner.  I even built a new development environment on another machine just to make sure it wasn't some brain-dead Windows issue: no dice.&lt;br /&gt;&lt;br /&gt;Tuesday night, I went to the local Ruby on Rails Meetup and got the answer from another Windows-based developer Hob Spillane -- thanks!&lt;br /&gt;&lt;br /&gt;So... drum roll please... here's how to get Cap working on your system:&lt;br /&gt;&lt;br /&gt;You MUST have the svn binaries installed on your Windows client machine and in your execution path before Cap can deploy successfully -- the GUI clients do not provide what Capistrano needs.  The binary you need depends on the version of Apache that your provider is running: 2.0 and 2.2 require different binaries.&lt;br /&gt;&lt;br /&gt;For my Apache 2.2, I went to the &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100&amp;expandFolder=8100&amp;amp;folderID=8100"&gt;subversion download page&lt;/a&gt;, and clicked on the &lt;a href="http://subversion.tigris.org/files/documents/15/38212/svn-win32-1.4.4.zip"&gt;                             svn-win32-1.4.4.zip&lt;/a&gt; link, installed it in /usr/bin/svn/bin, added that directory to my PATH statement and -- voila! -- Capistrano deploys like a charm! (When I went to the download site, there was only the choice of a zip file, no setup.exe. That may change by the time you get there.)&lt;br /&gt;&lt;br /&gt;If your version is Apache 2.0, go to &lt;a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=91"&gt;this download page&lt;/a&gt; and chose the appropriate setup.exe or .zip file.&lt;br /&gt;&lt;br /&gt;Nice...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-695524907364724001?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/695524907364724001/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2007/07/capistrano-on-windows-client.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/695524907364724001'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/695524907364724001'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2007/07/capistrano-on-windows-client.html' title='Capistrano on Windows client...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-5698685989507830699</id><published>2007-04-28T15:07:00.000-07:00</published><updated>2007-04-28T15:25:49.327-07:00</updated><title type='text'>Of presentations and security...</title><content type='html'>So... I had the chance to give a presentation to the East Bay Ruby on Rails &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Meetup&lt;/span&gt; Group (that's the Oakland part of the San Francisco Bay) about what it's like to be a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;nuby&lt;/span&gt;. Bottom line: the first step is an easy one, but after that it's a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;doozy&lt;/span&gt; (see the presentation &lt;a href="http://files.meetup.com/310796/Learning%20Ruby%20on%20Rails.pdf"&gt;here&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;During the great discussion that followed, one of the group pointed out that production logging is at the :info level and that's not good -- information entered into the site is stored in clear text and therefore not as secure as it should be (people still have to hack the site, but obviously that's not good enough).&lt;br /&gt;&lt;br /&gt;So I set about closing this loophole and also getting the sessions out of file storage and into the database where they are protected via password.&lt;br /&gt;&lt;br /&gt;This should have been simple and easy, but it turned out to be really tricky: an example of things not being exactly what they seem to be.  Here's the deal.&lt;br /&gt;&lt;br /&gt;I had previously updated my environment.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;rb&lt;/span&gt; file to customize the logger, having found this code snippet at snippets.com.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;config&lt;/span&gt;.logger = Logger.new("#{RAILS_ROOT}/log/#{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;ENV&lt;/span&gt;['RAILS_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;ENV&lt;/span&gt;']}.log",2, 131072)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For some reason I couldn't get it to work as I reported in an &lt;a href="http://nubyrubyrailstales.blogspot.com/2007/04/more-on-ruby-documentation-or-should-i.html"&gt;earlier post&lt;/a&gt;. I had finally gotten it to work (I think it may have had to do with restarting my server, but it's unclear) and life was good: I had smaller logs and didn't have to wait so long for it to load when I was doing some testing.&lt;br /&gt;&lt;br /&gt;However, what I found was that -- once this new logger was running -- I couldn't change the logging level (normally done with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;config&lt;/span&gt;.log_level in environment.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;rb&lt;/span&gt; or environments/production.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;rb&lt;/span&gt;). I wanted a logging level of :error (instead of :info) so that the operation of the site wasn't so readily stored.  I tried a number of things, including the following code in environment.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;rb&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;if &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;ENV&lt;/span&gt;['RAILS_&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;ENV&lt;/span&gt;'] == 'production'&lt;br /&gt;    &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;config&lt;/span&gt;.log_level = :error&lt;br /&gt;  else&lt;br /&gt;    &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;config&lt;/span&gt;.log_level = :debug&lt;br /&gt;  end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;but that didn't work... things kept getting logged at the :info level in production -- definitely not good.&lt;br /&gt;&lt;br /&gt;I also tried setting it with config.logger.log_level = :error but that didn't seem to work either.&lt;br /&gt;&lt;br /&gt;I finally -- after much futzing around -- decided simply to remove the new Logger snippet and see if that would do the trick: and it did. Now I can set the logging level in production (in the environments/production.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;rb&lt;/span&gt; file) with a simple &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;config&lt;/span&gt;.log_level = :error.&lt;br /&gt;&lt;br /&gt;Someday I'll go back and try to understand what happened. For now, the system is operating the way I want it to and I've moved the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;config&lt;/span&gt;.logger snippet to my environments/development.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;rb&lt;/span&gt; file so that I have that capability in development where I really need it.&lt;br /&gt;&lt;br /&gt;Fortunately, the sessions question was as easy as 1-2-3:&lt;br /&gt;&lt;br /&gt;1. Run the command:&lt;br /&gt;        rake db:sessions:create&lt;br /&gt;2. Run the migration:&lt;br /&gt;        rake db:migrate&lt;br /&gt;3. Change the production.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;rb&lt;/span&gt; file:&lt;br /&gt;          config.action_controller.session_store = :active_record_store&lt;br /&gt;&lt;br /&gt;and we're in business!&lt;br /&gt;&lt;br /&gt;This is really an analogy for my experience with Rails: some of it is subtly obscure and challenging (like the Logger situation), while some of it is wonderfully intuitive and easy (like the Sessions situation).&lt;br /&gt;&lt;br /&gt;Let's hear it for more of the latter!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-5698685989507830699?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/5698685989507830699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/of-presentations-and-security.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5698685989507830699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/5698685989507830699'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/of-presentations-and-security.html' title='Of presentations and security...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-2718587243553218248</id><published>2007-04-12T16:46:00.000-07:00</published><updated>2007-04-12T16:49:38.775-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='passwords'/><category scheme='http://www.blogger.com/atom/ns#' term='secure'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby rails nuby'/><title type='text'>Applicaton is live!</title><content type='html'>Well... I finally got the application out there, up, and running. It obviously still has much work to be done, but the basic secure functionality is there.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.4mypasswords.com"&gt;4&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MyPasswords&lt;/span&gt; &lt;/a&gt;-- a secure well-lighted place to store you passwords and other confidential information (e.g., Frequent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Flyer&lt;/span&gt; numbers; credit card numbers; ...)&lt;br /&gt;&lt;br /&gt;Feedback welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-2718587243553218248?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/2718587243553218248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/applicaton-is-live.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2718587243553218248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/2718587243553218248'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/applicaton-is-live.html' title='Applicaton is live!'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2958021377042600373.post-3829732323441089463</id><published>2007-04-08T11:41:00.000-07:00</published><updated>2007-04-08T11:54:35.479-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='ruby rails nuby'/><title type='text'>A nice plugin for secure sites...</title><content type='html'>I realize that I didn't comment about the &lt;a href="http://dev.rubyonrails.org/browser/plugins/ssl_requirement"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ssl&lt;/span&gt;_requirement&lt;/a&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;plugin&lt;/span&gt; by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;DHH&lt;/span&gt; (David &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Heinemeier&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Hansson&lt;/span&gt;, the Rails guru) . It's really a very nice approach to requiring that certain actions be accessed only through &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SSL&lt;/span&gt;/https and letting the other actions through. Once I found it, it was quick and easy to install and worked flawlessly.&lt;br /&gt;&lt;br /&gt;However, I couldn't use it: the fundamental controller for my application uses &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;AjaxScaffold&lt;/span&gt; (AS), which provides all the CRUD/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;UI&lt;/span&gt; stuff that I needed and allowed the customizations that I wanted (albeit with some learning curve; see a previous post).  AS uses a veritable galaxy of actions to perform its magic and there was no way (I tried) to identify the right actions individually.  What I really needed was a way to identify a &lt;span style="font-style: italic;"&gt;controller&lt;/span&gt; instead of an &lt;span style="font-style: italic;"&gt;action&lt;/span&gt; that required &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;SSL&lt;/span&gt;.  I briefly considered and then as quickly rejected the idea of attempting to enhance the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;plugin&lt;/span&gt;. It's a small plugin and seems to be pretty straight-forward in operation, but I'm just not at that level and I wanted to focus on my basic application.  Maybe another time...&lt;br /&gt;&lt;br /&gt;I did have one other question regarding the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;plugin&lt;/span&gt;. Reviewing the code, I saw that it works by trapping and then redirecting the actions that you want secured. I wonder if that might not be too much overhead for a site with lots of traffic?  I just don't know at this point.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2958021377042600373-3829732323441089463?l=www.nubyrubyrailstales.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.nubyrubyrailstales.com/feeds/3829732323441089463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/nice-plugin-for-secure-sites.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3829732323441089463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2958021377042600373/posts/default/3829732323441089463'/><link rel='alternate' type='text/html' href='http://www.nubyrubyrailstales.com/2007/04/nice-plugin-for-secure-sites.html' title='A nice plugin for secure sites...'/><author><name>JESii</name><uri>http://www.blogger.com/profile/03694926683464859622</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/_BRhkpMuOk1g/SnWTF9whp1I/AAAAAAAAAIk/m6-ulJ6_kEY/S220/Jon-Raiders_small%2Bsquare.jpg'/></author><thr:total>0</thr:total></entry></feed>
