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 […]
In: Ruby on Rails, Server Config, Ubuntu Tricks · Tagged with: Memcached, Ruby, rubygems
Xapian & Ruby Enterprise in Ubuntu
How to fix ‘No Ruby bindings for Xapian installed’ on Ubuntu after upgrading to RubyEnterprise
In: Ruby on Rails · Tagged with: Ruby, ruby enterprise, Ubuntu 9.04, xap, Xapian
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)
In: Uncategorized · Tagged with: blocks, Proc, Rails, Ruby, to_proc
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 […]
In: Uncategorized · Tagged with: arrays, collections, enumerations, Rails, Ruby
Ruby trick – Save a sort for later, Reuse a sort block
Sort multiple arrays with a single block/proc
In: Uncategorized · Tagged with: Block, Proc, Reuse, Ruby, Sort