11 August 2012

Fix Readline error Ubuntu

Fix readline error with Ruby

sudo apt-get install libreadline-dev

cd ~/.rvm/src/ruby-1.8.7-p249/ext/readline

ruby extconf.rb && make && make install


10 August 2012

Capistrano + GIT : Too many arguments while deployment

Issue : shell command failed with return code 33024

It's a ruby + git clone + windows issue.

If I chain commands with && while calling system(cmd) from ruby, chaining "git clone" with other commands is not fine. Git clone perceives the chained commands as its own continuation, i.e. as a destination directory, unless I run it from the command line.
As I couldn't find any references or solutions to this problem on the internet, I put a hack to capistrano code, so "git clone" is executed separately. 

In <ruby directory>\lib\ruby\gems\1.8\gems\capistrano-2.5.18\lib\capistrano\recipes\deploy\strategy\base.rb after the line 53 (cmd = cmd.split...)
add the following lines:
if cmd =~ /\s\&\&\s/ && cmd =~ /^git\s+clone/
   cmd1, cmd = cmd.split(" && ", 2)

it checks if it's a chained command and the first command is "git clone", and if such it executes it separately. It may not work for all possible cases.

Also you can try using ubuntu from your local.


09 August 2012

Installing RMagick with Imagemagic on Windows 7/Vista

2. Install Imagemagick
Use the 32 bit version, 64bit is not working.
http://www.imagemagick.org/download/binaries/ImageMagick-6.7.6-1-Q16-windows-dll.exe (2012-03-22)
Install dev headers (Check!)
Install into C:\opt\

3. Restart the console/cmd prompt/IDE/.. or just restart windows to make Imagemagick commands available

4. Install rmagick
gem install rmagick --platform=ruby -- --with-opt-lib=C:/opt/ImageMagick-6.7.6-Q16/lib --with-opt-include=c:/opt/ImageMagick-6.7.6-Q16/include