Thursday, July 21, 2011

CruiseControl.rb and Rails 3 with RVM

Hello. There is no article how to configure CruiseControl.rb(ccrb) for Rails 3 with RVM on internet so far. That's pity. Let's fix it.

First, install ccrb (just download and unzip from https://github.com/thoughtworks/cruisecontrol.rb/downloads).
Create new ccrb project named 'your_project'.

Then let's open ~/.cruise/projects/your_project/cruise_config.rb with your favorite editor.
Uncomment next line:
project.build_command = './build_my_app.sh'
Add build_by_app.sh to your rails application so full path should be ~/.cruise/projects/your/project/work/build_by_app.sh. 
This file should contain next lines:
#!/bin/bash
# Load RVM into a shell session *as a function*
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
  # First try to load from a user install
  source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
  # Then try to load from a root install
  source "/usr/local/rvm/scripts/rvm"
else
  printf "ERROR: An RVM installation was not found.\n"

fi

bundle install
bundle exec cucumber

Start ccrb and build.

Saturday, March 19, 2011

rvm's zlib issue

I had problem with rubygem in rvm's ruby because ruby wasn't compiled with zlib support. You can avoid this issue if you'll install this packages:
sudo apt-get install zlib1g-dev libssl-dev libreadline5-dev libxml2-dev libsqlite3-dev
From this page

Friday, January 21, 2011

In memory sqlite database for testing Rails 3 app with Cucumber and RSpec

Hello.
Let me introduce you my way of using in memory database inspite of existence of plenty articles regarding this on internets.

config/database.yml
test: &test
  adapter: sqlite3
  encoding: utf8
  database: ":memory:" 

In cucumber's features/support/env.rb in Before paste this:
load_schema = lambda {
    # use db agnostic schema by default
    load "#{Rails.root.to_s}/db/schema.rb" 

    # if you use seeds uncomment next line
    # load "#{Rails.root.to_s}/db/seeds.rb"
    # ActiveRecord::Migrator.up('db/migrate') # use migrations
  }
  silence_stream(STDOUT, &load_schema) 

Add lines below to spec/spec_helper.rb:
load_schema = lambda {
    load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
    # ActiveRecord::Migrator.up('db/migrate') # use migrations
  }
  silence_stream(STDOUT, &load_schema) 

Wednesday, July 21, 2010

XAMPP 403 Access Forbidden Problem

It's the second time when I got "403 Access Forbidden" in XAMPP under Mac OS X. First time I solved somehow.
Today I found what the problem is. I just set my User and Group parameters in /Applications/XAMPP/etc/httpd.conf.

You may think it's obvious but I've never set this things on Linux.

Monday, May 10, 2010

Issue on PyroCMS bugtrack.

http://github.com/philsturgeon/pyrocms/issues/issue/207

Saturday, March 20, 2010

FOSS meeting

Today I was at the malaysian FOSS community meeting.
As usual for this kind of meetings there were presentations.
Victor Yap told about Blender, changes between versions 2.49 and 2.50. Show several movies of Durian team (http://durian.blender.org) and movie of his team with nice girl and lion.
In next short presentations I got information about Hackerspace in Kuala Lumpur.
And next presentation was really interesting for me. Presenter told about Arduino (http://arduino.cc). Very nice hardware solution. I think I'll play with Arduino very soon.