Archive for the ‘Ruby on Rails’ Category

Memcached – Libmemcached already built; run ‘rake clean’ first if you need to rebuild.

Trying to install memcached ruby gem on Ubuntu 10.04 Lucid Lynx and I get the error Libmemcached already built; run ‘rake clean’ first if you need to rebuild. Fixed this by installing sudo apt-get install libsasl2-dev gem uninstall memcached && gem install memcached Full Error Stacktrace:

Posted on June 28, 2010 at 2:10 pm by Jordan Carter · Permalink · 5 Comments
In: Ruby on Rails, Server Config, Ubuntu Tricks · Tagged with: , ,

Developing Ruby on Rails on Ubuntu Lucid Lynx 10.04

Update: For Installing Ruby on Rails onto a Ubuntu Server (Lucid Lynx 10.04) goto this post Developing for any Web Application can be helped by developing in the same environment as the deployment.  For me this means that running Ubuntu Desktop and deploying onto Ubuntu Server is a no brainer.  Most Ruby on Rails developers […]

Posted on June 8, 2010 at 2:54 pm by Jordan Carter · Permalink · Leave a comment
In: Ruby on Rails, Server Config · Tagged with: 

Sending Emails with Rails, multipart html plain with Attachments

When trying to send attachments along with type versons of an email (html and plain text) you might notice that there is no content in your email message.  While I found this out too.  Simple if not over the top solution. The trick is that you have to put the html and plain part inside […]

Posted on June 3, 2010 at 5:36 am by Jordan Carter · Permalink · 3 Comments
In: Ruby on Rails · Tagged with: , ,

what changes did I just pull from git?

Ever wanted to see what changes you just pulled from github? This little command will show you the changes for the last commit, if the pull resulted in more commits being pulled then add a couple more ‘^’s to HEAD^ git diff HEAD^ HEAD

Posted on May 14, 2010 at 4:12 pm by Jordan Carter · Permalink · Leave a comment
In: Ruby on Rails · Tagged with: 

Git cherry-pick

cherry-pick is a useful Git command, especially if you are working in an Agile team. We used it for the first time today on our project. Team member A lets call him “James” made a feature and put it onto master. Team member B lets call him “Jordan” later refactered some code from “James”‘s feature.  […]

Posted on May 14, 2010 at 1:15 pm by Jordan Carter · Permalink · 3 Comments
In: Ruby on Rails · Tagged with: 

uninitialized constant Encoding

Problem with Rails sqlite3? uninitialized constant Encoding Couldn’t create database for {“timeout”=>5000, “adapter”=>”sqlite3”, “database”=>”db/test.sqlite3”, “pool”=>5} If you installed the gem ‘sqlite3’ then sudo gem uninstall sqlite3 sudo gem install sqlite3-ruby Fixed!

Posted on May 7, 2010 at 4:43 pm by Jordan Carter · Permalink · Leave a comment
In: Ruby on Rails · Tagged with: , ,

PostGIS psqlostgis ERROR could not load library /usr/lib/postgresql/8.4/lib/postgis-1.5.so

Trying to install PostGIS and you can’t get past this error? psqlostgis.sql:57: NOTICE:  type “spheroid” is not yet defined DETAIL:  Creating a shell type definition. psqlostgis.sql:57: ERROR:  could not load library “/usr/lib/postgresql/8.4/lib/postgis-1.5.so”: /usr/lib/postgresql/8.4/lib/postgis-1.5.so: undefined symbol: GEOSHausdorffDistance psqlostgis.sql:63: ERROR:  current transaction is aborted, commands ignored until end of transaction block psqlostgis.sql:68: ERROR:  current transaction is aborted, […]

Posted on March 10, 2010 at 12:44 pm by Jordan Carter · Permalink · 5 Comments
In: Ruby on Rails, Server Config · Tagged with: , , , ,

Fetch Email Attachments with Ruby on Rails

This snippet is used in one of my projects to automatically import a csv into the database. It uses cron to check an email account via IMAP. When a unread email is found it will try to match it to subject lines in the database. If there is an entry it will attempt to import […]

Posted on December 28, 2009 at 8:34 am by Jordan Carter · Permalink · Leave a comment
In: Ruby on Rails · Tagged with: , , , , ,