Wetware » Ruby

Rails or Ruby Memcached Gem on Ubuntu and Linux

Get the following error when trying to install memcached ruby gem on your Ubuntu or Linux box? rlibmemcached_wrap.c: In function ‘_wrap_memcached_get_sasl_callbacks’: rlibmemcached_wrap.c:12413: error: ‘sasl_callback_t’ undeclared (first use in this function) rlibmemcached_wrap.c:12413: error: ‘result’ undeclared (first use in this function) rlibmemcached_wrap.c:12424: error: expected expression before ‘)’ token rlibmemcached_wrap.c: In function ‘Init_rlibmemcached’: rlibmemcached_wrap.c:13694: error: ‘SASL_OK’ undeclared (first […]

Posted on October 13, 2010 at 9:26 am by Jordan Carter · Permalink · 2 Comments
In: Ruby on Rails, Server Config, Ubuntu Tricks · Tagged with: , ,

Xapian & Ruby Enterprise in Ubuntu

How to fix ‘No Ruby bindings for Xapian installed’ on Ubuntu after upgrading to RubyEnterprise

Posted on October 14, 2009 at 3:48 pm by Jordan Carter · Permalink · One Comment
In: Ruby on Rails · Tagged with: , , , ,

Map and to_proc to easier capitalize array of strings

["auckland", "christchurch", "wellington", "hamilton", "tauranga", "dunedin", "palmerston north", "hastings", "nelson", "napier", "rotorua", "new plymouth", "whangarei", "invercargill", "wanganui", "gisborne"].map(&:capitalize)

Posted on April 1, 2009 at 10:17 am by Jordan Carter · Permalink · 2 Comments
In: Uncategorized · Tagged with: , , , ,

Ruby on Rails – Easier enumerations (Select, Collect, Map) using Ampersand

a = [] # setup array 0.upto(100) do #just make up some array a << rand(1000) end s = a.in_groups_of(6,false) # make it an array of arrays (so we can use the sort method on each element of the outer array) s.collect(&:sort) #sort each array inside the outer array in one easy step What are […]

Posted on March 31, 2009 at 10:31 am by Jordan Carter · Permalink · One Comment
In: Uncategorized · Tagged with: , , , ,

Ruby trick – Save a sort for later, Reuse a sort block

Sort multiple arrays with a single block/proc

Posted on March 29, 2009 at 12:09 pm by Jordan Carter · Permalink · Leave a comment
In: Uncategorized · Tagged with: , , , ,