<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Procbits &#187; Ruby</title>
	<atom:link href="http://procbits.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://procbits.com</link>
	<description>source code snippets and other random musings about software</description>
	<lastBuildDate>Wed, 01 Feb 2012 19:41:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='procbits.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Procbits &#187; Ruby</title>
		<link>http://procbits.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://procbits.com/osd.xml" title="Procbits" />
	<atom:link rel='hub' href='http://procbits.com/?pushpress=hub'/>
		<item>
		<title>Automating the Generation of iOS Push Notification Certificates</title>
		<link>http://procbits.com/2011/10/10/automating-generation-ios-push-notification-certificates/</link>
		<comments>http://procbits.com/2011/10/10/automating-generation-ios-push-notification-certificates/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 01:00:24 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=245</guid>
		<description><![CDATA[I have a large number (200+) of iOS applications. I needed to generate push notification certificates for each of them. If you&#8217;ve ever gone through the process, it can be a huge pain to do just a few. I needed to write a script to automate this process. First, I created a ruby gem to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=245&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a large number (200+) of iOS applications. I needed to generate push notification certificates for each of them. If you&#8217;ve ever gone through the process, it can be a huge pain to do just a few. I needed to write a script<br />
to automate this process.</p>
<p>First, I created a <a href="http://procbits.com/2011/10/07/automating-the-mac-os-x-keychain-app-with-ruby/">ruby gem to access the Mac OS X Keychain App</a>.</p>
<p>Next, I leveraged <a href="http://watir.com/">watir</a> to actually login to the iOS provisioning portal and upload/download the necessary files.</p>
<p>First, make sure that you&#8217;re using Mac OS X 10.7 (Lion) and that you have Chrome and Ruby 1.9.2 installed.</p>
<ol>
<li>Download chromedriver http://code.google.com/p/chromium/downloads/list</li>
<li>Move the binary to /usr/local</li>
</ol>
<p>Next, run these commands:<br />
<pre class="brush: bash;">
git clone git://github.com/jprichardson/GeneratePushCerts.git
gem install 'keychain_manager'
gem install 'watir-webdriver'
cd ./GeneratePushCerts
</pre></p>
<p>Modify the &#8216;config.example.yml&#8217; file with your iOS developer/provisioning portal credentials. Rename the file<br />
to &#8216;config.yml&#8217;.</p>
<p>You&#8217;ll want to edit &#8216;app.rb&#8217; and modify the END_WITH variable and set it to &#8221;. I should have created a regular expression around line 60.</p>
<p>Run the app &#8216;ruby app.rb&#8217;.</p>
<p>Let&#8217;s take a look at some watir code from the file:<br />
<pre class="brush: ruby;">
  browser.checkbox(id: 'enablePush').click() #enable configure buttons
  browser.button(id: 'aps-assistant-btn-prod-en').click() #configure button

  Watir::Wait.until { browser.body.text.include?('Generate a Certificate Signing Request') }

  browser.button(id: 'ext-gen59').click() #on lightbox overlay, click continue

  Watir::Wait.until { browser.body.text.include?('Submit Certificate Signing Request') }

  browser.file_field(name: 'upload').set(CERT_REQUEST_FILE)
  browser.execute_script(&quot;callFileValidate();&quot;)
  #browser.file_field(name: 'upload').click() #calls some local javascript to validate the file and enable continue button, unfortunately File Browse dialog shows up

  browser.button(id: 'ext-gen75').click()

  Watir::Wait.until(WAIT_TO) { browser.body.text.include?('Your APNs SSL Certificate has been generated.') }

  browser.button(id: 'ext-gen59').click() #continue

  Watir::Wait.until { browser.body.text.include?('Step 1: Download') }

  File.delete(DOWNLOADED_CERT_FILE) if File.exists?(DOWNLOADED_CERT_FILE)

  browser.button(alt: 'Download').click() #download cert

  puts('Checking for existence of downloaded certificate file...')
  while !File.exists?(DOWNLOADED_CERT_FILE)
    sleep 1
  end

  Watir::Wait.until { browser.body.text.include?(&quot;Download &amp; Install Your Apple Push Notification service SSL Certificate&quot;) }

  browser.button(id: 'ext-gen91').click()
  browser.goto(APP_IDS_URL)
</pre></p>
<p>You can browse the entire <a href="https://github.com/jprichardson/GeneratePushCerts">source code on Github</a>.</p>
<p>I think watir is pretty intuitive and is a swiss army knife for automating the interaction with web pages. It&#8217;s pretty slow as it&#8217;s meant for testing, so I wouldn&#8217;t use it for screen scraping, but it&#8217;s served me well for this task.</p>
<p>Do you use Git? If so, checkout <a href="http://gitpilot.com">Gitpilot</a> to make using Git thoughtless.</p>
<p>Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my blog on entrepreneurship: <a href="http://techneur.com">Techneur</a>.</p>
<p>-JP Richardson </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=245&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/10/10/automating-generation-ios-push-notification-certificates/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Automating the Mac OS X Keychain App with Ruby</title>
		<link>http://procbits.com/2011/10/07/automating-the-mac-os-x-keychain-app-with-ruby/</link>
		<comments>http://procbits.com/2011/10/07/automating-the-mac-os-x-keychain-app-with-ruby/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 15:39:19 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=243</guid>
		<description><![CDATA[Recently, I needed a way to automate the generation of 100+ Apple Push notification certificates for my iOS development. So, I created a Ruby Gem [keychain_manager] to automate the Mac OS X Keychain application. Here is how you can use it: gem install keychain_manager This gem could easily be modified to support other Keychain functions. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=243&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I needed a way to automate the generation of 100+ Apple Push notification certificates for my iOS development. So, I created a <a href="https://rubygems.org/gems/keychain_manager">Ruby Gem [keychain_manager]</a> to automate the Mac OS X Keychain application. </p>
<p>Here is how you can use it:<br />
<code><br />
gem install keychain_manager<br />
</code></p>
<p><pre class="brush: ruby;">
require 'keychain_manager'

USER = 'jprichardson@gmail.com'
KEYCHAIN = 'apple_push_keychain' #this can be anything, we just don't want to pollute the 'login' keychain
YOUR_DOWNLOADS_DIR = '' # you must set this, this is where the file aps_production_identity.cer exists

RSA_FILE = '/tmp/myrsa.key'
KeychainManager.generate_rsa_key(RSA_FILE)

CERT_FILE = '/tmp/CertificateSigningRequest.certSigningRequest'
KeychainManager.generate_cert_request(USER, 'US', CERT_FILE) #'US' is the country abbreviation.

kcm = KeychainManager.new(KEYCHAIN)
kcm.delete if kcm.exists?
kcm.create

kcm.import_rsa_key(RSA_FILE)

#now from your browser, you'll have downloaded a file from Apple typically named: aps_production_identity.cer
kcm.import_apple_cert(File.join(YOUR_DOWNLOADS_DIR, '/aps_production_identity.cer'))

P12_FILE = '/tmp/push_prod.p12'
kcm.export_identites(P12_FILE)

PEM_FILE = '/tmp/push_prod.pem'
KeychainManager.convert_p12_to_pem(P12_FILE, PEM_FILE)

kcm.delete

#Now upload the PEM_FILE to your server.
</pre></p>
<p>This gem could easily be modified to support other Keychain functions. Browse the sourcecode here: <a href="https://github.com/jprichardson/keychain_manager">Keychain Manager source code</a>.</p>
<p>I&#8217;ll post soon on how I automated the web portion of communicating with the iOS Provisioning Portal.</p>
<p>Do you use Git? If so, checkout <a href="http://gitpilot.com">Gitpilot</a> to make using Git thoughtless.</p>
<p>Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my blog on entrepreneurship: <a href="http://techneur.com">Techneur</a>.</p>
<p>-JP Richardson </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=243&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/10/07/automating-the-mac-os-x-keychain-app-with-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Mongoid with Rspec</title>
		<link>http://procbits.com/2011/08/18/using-mongoid-with-rspec/</link>
		<comments>http://procbits.com/2011/08/18/using-mongoid-with-rspec/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 18:47:07 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bdd]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[mongoid]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=239</guid>
		<description><![CDATA[I&#8217;m a fan of testing. I&#8217;m still trying to discipline myself to test before I write code, that&#8217;s been a tough habit to develop, however testing after I develop a feature is a good habit that has paid dividends. Lately I&#8217;ve started learning how to use Rspec for Rails. Out of the box, Rspec is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=239&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a fan of testing. I&#8217;m still trying to discipline myself to test before I write code, that&#8217;s been a tough habit to develop, however testing after I develop a feature is a good habit that has paid dividends. Lately I&#8217;ve started learning how to use Rspec for Rails.</p>
<p>Out of the box, Rspec is configured to use ActiveRecord. I&#8217;ve pretty much stopped using relational databases in favor of NoSql solutions. My favorite NoSql DB is MongoDB. The Ruby MongoDB ORM that I&#8217;ve been using is <a href="http://mongoid.org/">Mongoid</a>.</p>
<p>To prep for Rspec, make your gemfile look like this (Assuming Rails 3.x):<br />
<pre class="brush: ruby;">
gem 'rspec-rails', :group =&gt; [:test, :development]
group :test do
  gem 'database_cleaner'
end
</pre></p>
<p>Then run:<br />
<code><br />
bundle install<br />
rails g rspec:install<br />
</code></p>
<p>When I started learning how to use Rspec, I started having problems. The first was the following error message:</p>
<p><code>undefined method `fixture_path=' for # (NoMethodError)</code></p>
<p>Oops, just needed to comment out the line spec_helper.rb:<br />
<pre class="brush: ruby;">
config.fixture_path = &quot;#{::Rails.root}/spec/fixtures&quot;
</pre></p>
<p>Was I safe yet? Nope. Another error:<br />
<code>undefined method `use_transactional_fixtures=' for # (NoMethodError)</code></p>
<p>Oops, just needed to comment out the line spec_helper.rb:<br />
<pre class="brush: ruby;">
config.use_transactional_fixtures = true
</pre></p>
<p>I should have known as the there are comments in the file.</p>
<p>Now, when I run my specs, the changes to the database persist from one test to the next. Ideally, you want a clean database when you start each test. This is where the gem <a href="https://github.com/bmabey/database_cleaner">database_cleaner</a> comes in handy.</p>
<p>Then add this to your spec_helper.rb file:<br />
<pre class="brush: ruby;">
  config.before(:suite) do
    DatabaseCleaner[:mongoid].strategy = :truncation
  end

  config.before(:each) do
    DatabaseCleaner[:mongoid].start
  end

  config.after(:each) do
    DatabaseCleaner[:mongoid].clean
  end
</pre></p>
<p>That&#8217;s it!</p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>If you made it this far, read my blog on <a href="http://techneur.com">software entrepreneurship</a> and follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=239&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/08/18/using-mongoid-with-rspec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Disable Sprockets for Rails in Development Mode</title>
		<link>http://procbits.com/2011/07/26/disable-sprockets-for-rails-in-development-mode/</link>
		<comments>http://procbits.com/2011/07/26/disable-sprockets-for-rails-in-development-mode/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 15:30:56 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=184</guid>
		<description><![CDATA[Sprockets (is/are)? the technology in Rails 3.1 and up that combines your CSS and Javascript files into one CSS and Javascript file. It remains to be seen if this was a positive change or not. The argument is that the client only has to make one HTTP request instead of many for each file; this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=184&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sprockets (is/are)? the technology in Rails 3.1 and up that combines your CSS and Javascript files into one CSS and Javascript file. It remains to be seen if this was a positive change or not. The argument is that the client only has to make one HTTP request instead of many for each file; this is a good thing. However, if you change one line in one of your Javascript files, the client then has to redownload the entire combined file instead of just the one Javascript file that you modified.</p>
<p>Regardless, you may want to disable Sprockets while you&#8217;re developing your Rails application. This will aid in debugging.</p>
<p>Change&#8230;<br />
<pre class="brush: ruby;">
&lt;%= stylesheet_include_tag &quot;application&quot; %&gt;
&lt;%= javascript_include_tag &quot;application&quot; %&gt;
</pre></p>
<p>to&#8230;<br />
<pre class="brush: ruby;">
&lt;%= stylesheet_include_tag &quot;application&quot;, debug: Rails.env.development? %&gt;
&lt;%= javascript_include_tag &quot;application&quot;, debug: Rails.env.development? %&gt;
</pre></p>
<p>Are you a Git user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my blog on software entrepreneurship: <a href="http://techneur.com">Techneur</a></p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=184&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/07/26/disable-sprockets-for-rails-in-development-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Feedzirra and Rails 3</title>
		<link>http://procbits.com/2011/01/25/feedzirra-and-rails-3/</link>
		<comments>http://procbits.com/2011/01/25/feedzirra-and-rails-3/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 03:50:17 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=114</guid>
		<description><![CDATA[Feedzirra is probably one of the best Ruby RSS parsers. But if you&#8217;re using it with Rails 3, you may get an error message like so: no such file to load -- active_support/core_ext/time If that happens, locate your feedzirra.rb file on your machine and comment out the lines: Add these lines: Are you a Git [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=114&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/pauldix/feedzirra">Feedzirra</a> is probably one of the best Ruby RSS parsers. But if you&#8217;re using it with Rails 3, you may get an error message like so:</p>
<p><code>no such file to load -- active_support/core_ext/time</code></p>
<p>If that happens, locate your feedzirra.rb file on your machine and comment out the lines:<br />
<pre class="brush: ruby;">
#require 'active_support/core_ext/object'
#require 'active_support/core_ext/time'
</pre><br />
Add these lines:<br />
<pre class="brush: ruby;">
require 'active_support/core_ext'
require 'active_support/time'
</pre></p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>Follow me on Twitter <a href="http://twitter.com/jprichardson">@jprichardson</a> and read my <a href="http://techneur.com">blog on building a software business</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=114&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2011/01/25/feedzirra-and-rails-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Mongoid UTC Times</title>
		<link>http://procbits.com/2010/09/23/mongoid-utc-times/</link>
		<comments>http://procbits.com/2010/09/23/mongoid-utc-times/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 03:36:31 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=76</guid>
		<description><![CDATA[By default Mongoid will store your Time objects in your local timezone. It&#8217;s not made clear on the installation page, but all you have to do is add &#8220;use_utc: true&#8221; to the defaults in your mongoid.yml configuration file. Yes Virginia, it&#8217;s that simple. Are you a Git user? Let me help you make project management [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=76&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>By default Mongoid will store your Time objects in your local timezone. It&#8217;s not made clear on the <a href="http://mongoid.org/docs/installation/">installation page</a>, but all you have to do is add &#8220;use_utc: true&#8221; to the defaults in your mongoid.yml configuration file. Yes Virginia, it&#8217;s that simple.</p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=76&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2010/09/23/mongoid-utc-times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>RVM Is a Must for the Rubyist</title>
		<link>http://procbits.com/2010/09/08/rvm-is-a-must-for-the-rubyist/</link>
		<comments>http://procbits.com/2010/09/08/rvm-is-a-must-for-the-rubyist/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 04:59:46 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=67</guid>
		<description><![CDATA[If you are a Ruby or Rails developer and you haven&#8217;t heard of RVM yet, I&#8217;ll let you in on the secret. It rocks! Basically, RVM allows you to easily simultaneously run multiple ruby version on the same machine. You see, Rails 3.0 just came out and I thought it would run on Ruby 1.9.1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=67&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are a Ruby or Rails developer and you haven&#8217;t heard of <a href="http://rvm.beginrescueend.com/">RVM</a> yet, I&#8217;ll let you in on the secret. It rocks! Basically, RVM allows you to easily simultaneously run multiple ruby version on the same machine. You see, Rails 3.0 just came out and I thought it would run on Ruby 1.9.1 but it won&#8217;t. It require&#8217;s Ruby 1.9.2. So I upgraded my OS X dev box and manually created the new symlinks. All was well, but I wasn&#8217;t sure how my apps that required 1.9.1 would behave. So I researched RVM.</p>
<p>To install on your OS X box, it&#8217;s quite simple. Just make sure that you have XCode installed, as you&#8217;ll need the GCC.</p>
<p><pre class="brush: bash;">
bash &lt; &lt;( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
</pre></p>
<p>That&#8217;s all you need to do to install it! </p>
<p>Edit ~./.bash_profile with the following:<br />
<pre class="brush: bash;">
[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; source &quot;$HOME/.rvm/scripts/rvm&quot;  
</pre></p>
<p>Open a new shell and you&#8217;re ready to rock.</p>
<p>To install a Ruby version 1.9.2, just type:<br />
<pre class="brush: bash;">
rvm install 1.9.2
</pre></p>
<p>Or for version 1.8.7<br />
<pre class="brush: bash;">
rvm install 1.8.7
</pre></p>
<p>Switch versions like:<br />
<pre class="brush: bash;">
rvm 1.9.2
</pre></p>
<p>To see where &#8220;ruby&#8221; is actually installed you type:<br />
<pre class="brush: bash;">
which ruby
</pre></p>
<p>You&#8217;ll see:<br />
<pre class="brush: bash;">
/Users/jp/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
</pre></p>
<p>To see the gem path:<br />
<pre class="brush: bash;">
gem env path
</pre></p>
<p>Its output:<br />
<pre class="brush: bash;">
/Users/jp/.rvm/gems/ruby-1.9.2-p0:/Users/jp/.rvm/gems/ruby-1.9.2-p0@global
</pre></p>
<p>It&#8217;s like magic! Take note: <a href="http://rvm.beginrescueend.com/rvm/install/">according to the guide</a>, you should NOT run &#8220;sudo&#8221; to install rvm.</p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>Read me blog on entrepreneurship: <a href="http://techneur.com">Techneur</a><br />
Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a></p>
<p>-JP </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=67&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2010/09/08/rvm-is-a-must-for-the-rubyist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Levenshtein in Ruby 1.9</title>
		<link>http://procbits.com/2010/08/07/levenshtein-in-ruby-1-9/</link>
		<comments>http://procbits.com/2010/08/07/levenshtein-in-ruby-1-9/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 06:59:53 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=49</guid>
		<description><![CDATA[In Ruby 1.8, I would use the gem &#8216;levenshtein&#8217;&#8230; well that doesn&#8217;t work in 1.9. So you need to install the gem &#8216;text&#8217;. Then the call is as simple as: Are you a Git user? Let me help you make project management with Git simple. Checkout Gitpilot. Follow me on Twitter: @jprichardson -JP<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=49&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In Ruby 1.8, I would use the gem &#8216;levenshtein&#8217;&#8230; well that doesn&#8217;t work in 1.9. So you need to install the gem &#8216;text&#8217;.</p>
<p>Then the call is as simple as:<br />
<pre class="brush: ruby;">
Text::Levenshtein.distance('hello', 'hell')
</pre></p>
<p>Are you a <a href="http://gitpilot.com" target="_blank">Git</a> user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<p>Follow me on Twitter: <a href="http://twitter.com/jprichardson">@jprichardson</a></p>
<p>-JP</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=49&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2010/08/07/levenshtein-in-ruby-1-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying a Rails application on Ubuntu 8.04 LTS with Phusion Passenger and SQL Server 2005</title>
		<link>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/</link>
		<comments>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 05:50:10 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://procbits.com/?p=5</guid>
		<description><![CDATA[This article will provide step by step instructions for preparing and then deploying a Rails application on Ubuntu 8.04 LTS that uses Microsoft SQL Server 2005. Install Ruby sudo apt-get install ruby-full build-essential Install Apache 2 sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev Install Ruby Gems Do not install Ruby Gems from Apt.  This will screw [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=5&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>This article will provide step by step instructions for preparing and then deploying a Rails application on Ubuntu 8.04 LTS that uses Microsoft SQL Server 2005.</p>
<p><strong>Install Ruby</strong><br />
<code>sudo apt-get install ruby-full build-essential</code></p>
<p><strong>Install Apache 2</strong><br />
<code>sudo apt-get install apache2 apache2-mpm-prefork apache2-prefork-dev</code></p>
<p><strong>Install Ruby Gems</strong><br />
Do not install Ruby Gems from Apt.  This will screw up your Gems repository as Apt and Gems will both want to manage it.  Download the latest Gems package from <a href="http://rubyforge.org/" target="_blank">http://rubyforge.org</a>.  At the time of this writing the latest version is 1.3.  Version 1.3 is also the version that I used.<code><br />
wget <a href="http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz" target="_blank">http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz</a><br />
tar xzvf rubygems-1.3.0.tgz<br />
cd rubygems-1.3.0<br />
sudo ruby setup.rb<br />
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem<br />
sudo gem update --system</code></p>
<p><strong>Install Rails</strong><br />
Make sure to install the proper version.  You may need to pass the &#8220;&#8211;version&#8221; flag.<br />
<code>sudo gem install rails</code></p>
<p><strong>Install Phusion Passenger</strong><br />
This allows us to deploy Rails application with as much simplicity as it takes to deploy a PHP application.  This we can avoid using Mongrel/Proxy Balancing/(Apache|Lighttpd|Nginx).<code><br />
sudo gem install passenger<br />
sudo passenger-install-apache2-module</code></p>
<p>Next add the following to your /etc/apache2/apache2.conf file:<br />
<code> LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3<br />
PassengerRuby /usr/bin/ruby1.8</code></p>
<p><strong>Install Ruby/ODBC/SQLServer2005 Compatibility</strong><br />
In /etc/profile add the following:<br />
<code> export ODBCINI=/etc/odbc.ini<br />
export ODBCSYSINI=/etc<br />
export FREETDSCONF=/etc/freetds/freetds.conf</code></p>
<p>Make sure you restart your shell after this!</p>
<p>Now install UnixODBC:<code><br />
sudo apt-get install unixodbc<br />
sudo apt-get install unixodbc-dev<br />
sudo apt-get install tdsodbc<br />
</code></p>
<p>Now install FreeTDS (stable) from source. The FreeTDS in the Apt repository is version 0.63 and will not work with SQL Server 2005. At the time of this writing, the current stable version is 0.82.<code><br />
wget <a href="ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz" target="_blank">ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz</a><br />
cd freetds-stable<br />
./configure<br />
make<br />
sudo make install</code></p>
<p>Edit /etc/freetds/freetds.conf and add the following:<code><br />
[YOUR_DB_DEFINITION_NAME]<br />
host = 172.24.40.100<br />
port = 1433<br />
tds version = 8.0<br />
</code></p>
<p>Test it with the following:<code><br />
sqsh -S YOUR_DB_DEFINITION_NAME -U USERNAME -P PASSWORD<br />
</code></p>
<p>Once actually logged in, you can run some SQL and verify the results. Make sure to type “go” after each command and also make sure to “use” the right database.</p>
<p>Now edit /etc/odbc.ini and add the following:<code><br />
[YOUR_DB_DEFINITION_NAME]<br />
Driver          = FreeTDS<br />
Description     = ODBC connection via FreeTDS<br />
Trace           = No<br />
Servername      = YOUR_DB_DEFINITION_NAME<br />
Database        = YOUR_ACTUAL_DB_NAME<br />
</code></p>
<p>Edit /etc/odbcinst.ini and add the following:<code><br />
[FreeTDS]<br />
Description     = TDS driver (Sybase/Microsoft SQL)<br />
Driver          = /usr/lib/odbc/libtdsodbc.so<br />
Setup           = /usr/lib/odbc/libtdsS.so<br />
CPTimeout       =<br />
CPReuse         =<br />
FileUsage       = 1<br />
</code></p>
<p>Now test it….<code><br />
isql YOUR_DB_DEFINITION_NAME USERNAME PASSWORD<br />
</code></p>
<p>Install Ruby ODBC:<code><br />
wget <a href="http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9995.tar.gz" target="_blank">http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9995.tar.gz</a><br />
tar zvxf ruby-odbc-0.9995.tar.gz<br />
cd ruby-odbc-0.9995/<br />
ruby extconf.rb<br />
make<br />
sudo make install<br />
</code></p>
<p>Install ActiveRecord ODBC Adapter<code><br />
sudo gem install activerecord-odbc-adapter<br />
</code></p>
<p>Edit your database.yml in your application and configure it like…<code><br />
development:<br />
adapter: odbc<br />
dsn: YOUR_DB_DEFINITION_NAME<br />
username: USERNAME<br />
password: PASSWORD<br />
</code></p>
<p>Now dump your Rails app in /var/www/yourrailsapp and add a new Apache Virtual Host as seen in the previous post. Configure the virtual host DocumentRoot to point to the public directory in Apache2.  Do not forget to change ownership of your rails app to www-data. (chown -R www-data:www-data yourrailsapp) That’s all there is too it! Now you can deploy a number of Rails apps in Apache with little trouble!</p></div>
<p>Are you a Git user? Let me help you make project management with Git simple. Checkout <a href="http://gitpilot.com" target="_blank">Gitpilot</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/procbits.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/procbits.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/procbits.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=procbits.com&amp;blog=6893023&amp;post=5&amp;subd=procbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://procbits.com/2009/03/10/deploying-a-rails-application-on-ubuntu-804-lts-with-phusion-passenger-and-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f56a5e429de009a27b0ae8f796ef2df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">JP</media:title>
		</media:content>
	</item>
	</channel>
</rss>
