Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

Ruby on Rails and Problems with Facebook Rake Task

Dec 22

If you’re new to developing Facebook applications with Rails then here’s a tip for you. You’ll need to install the RFacebook gem for starters: gem install rfacebook. If you read any of the online tutorials you’ll read that you need to run the rake facebook:setup task to create the facebook.yml file. You may end up seeing the following error message:

Don’t know how to build task ‘facebook:setup’

If so, you’ll need to install the rfacebook plugin using script/plugin install svn://rubyforge.org/var/svn/rfacebook/plugins/rfacebook_on_rails. After you install the plugin then rake facebook:setup should run perfectly and create your default facebook.yml file.

Read More

Ruby on Rails vs Java – Mac Style

Jul 29

Thought this was a pretty funny/geeky version of the Mac ads based on Rails vs Java. You gotta love what’s in the hibernate jar.

Ruby on Rails vs Java at RubyOnRailsVids.com

Ruby on Rails vs Java Video

Read More

Aptana on Rails

Jun 19

I’m pretending there hasn’t been a two month gap since my last post.  I’ve been caught up with a project called Ublip where we’ve spent a considerable amount of time reinventing ourselves.  Well let me rephrase that and say that we’ve pulled a superstar team together and taking a different approach….more on that later.

This post is say that although I still love TextMate for Rails development I’m growing more and more fond of Aptana.  This is mainly because the IDE is tightly integrated with support for Ruby, Rails, and Subversion.  It was formerly RadRails and looks like it has been picked up under the Aptana umbrella.  My biggest complaint with TextMate is the complexity in managing SVN repositories (checking files in/out, etc).  If you know of a clean and easy way to integrate SVN with TextMate then I’m all ears.  In the meantime I will use both until I decide to make the switch one way or the other.

Read More

Deploying Rails To Unix Using Capistrano

Apr 24

One of my favorite features of Rails is the great Capistrano deployment process.  I’ve been using Capistrano to deploy to Linux servers for several months now and absolutely love it.  Recently I ran into a problem deploying to a Unix server and couldn’t for the life of me figure out what was going on.  It turned out that the Unix account I was using for Capistrano deployment defaulted to the Bourne shell.  After much troubleshooting I realized certain commands were not executing correctly and that the Bourne-again shell was the desired solution.  After editing /etc/passwd to set my user account to bash I was good to go:

dennis:x:501:1::/home/dennis:/usr/bin/bash 

I was able to run cap setup and cap deploy with no complaints.  If you ever run into problems where you can deploy successfully to Linux, but not Unix, be sure to check your default shell.

Read More

Importing Your Rails Project into Subversion

Apr 20

I’m adding this post ignoring the fact that there’s been almost a two month gap since my last post. Let’s say that quite a bit has been going on. With that being said there’s always some mundane task that I need to accomplish, but can’t recall how to do. Today this task was getting my Rails project into my Subversion repository from the command line. I recently switched from Radrails to Textmate on my Mac and am working from the command line until I can get Textmate SVN working. Here’s the almighty command to get your Rails app into a remote repository. This assumes you’re working from the root of your Rails app:

svn import . http://svn.domain.com/svn/myapp -m “Import” –username dennis

I’m going to keep this handy as I spent 30 minutes trying to figure out how to do this. Thanks again Google.

Read More

Escaping Backslash with Ruby

Jan 14

I’ve been working with a Ruby script that inserts data into MySQL.  This data can contain all sorts of weird characters and then one that recently wrecked havoc on my insert was the backslash.  As you may know, under normal MySQL circumstances a single backslash (\) will need to be escaped with a double (\\).  So I played around with a few regular expressions until I stumbled across one that would replace a single backslash with a double:

color = ‘blue\green’
puts color.gsub(/\\/, ‘\&\&’)

Running this script yields:

blue\\green 

Ohhh the power of regular expressions.  Maybe someday I’ll take the time to actually understand them.  Until then I’ll continue to post snippets as a lazy reminder.

Read More