Posts Tagged ‘datamapper’

Using Sake to keep Merb and Datamapper on edge

Friday, July 25th, 2008
No Gravatar

a barrel used for holding sake

Here at dynamic50 we use the sake gem and associated tasks to keep merb and datamapper up to date locally.

Why would you want to do this?

  • It automates the compilation and installation of each individual gem
  • It does automatic updates on your local gems from source
  • You want to stay up to date as things are changing on a daily basis

To use sake, you need to install the gem first:
sudo gem install sake

If it bums out, you are probably either missing some dependencies, or don’t have the right versions of the dependencies.

Once installed get the sake recipes here:
sudo sake -i http://merbivore.com/merb-dev.sake
sudo sake -i http://datamapper.org/dm-dev.sake

You can then install merb and datamapper as follows:

Decide on where you want to put them:
mkdir merb_resources

Clone the repositories
sudo sake merb:clone
sudo sake dm:clone

Now install them!
cd merb
sake merb:install
cd ..
cd dm
sake dm:install

You can get a list of all available commands by typing
sake -T

How to configure a Ubuntu Slice for Merb + Datamapper

Sunday, July 20th, 2008
No Gravatar

This is a very rough and ready explanation of how to configure a slice for merb + datamapper.

This is for Ubuntu 7.10

- Add a user
adduser jason

- use visudo to add user to sudoers
visudo

- Stop remote root login
vi /etc/ssh/sshd_config
change PermitRootLogin to no

- Logout of root log back in a new user (jason)

- Update system
sudo apt-get update
sudo apt-get upgrade

- Build-essential
sudo apt-get install build-essential

- Git
sudo apt-get install git-core

- Ruby
sudo apt-get install ruby rdoc irb libyaml-ruby libzlib-ruby ri libopenssl-ruby

- Rubygems from source
Go to http://rubyforge.org/projects/rubygems/ to get the latest version
The new one is:
http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
So I do:
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar xvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo apt-get install ruby1.8-dev
sudo gem update—system

- Gems

N.B. try and run the command below on a 256 slice on slicehost and you will run into resource allocation issues. I would recommend upgrading to 512, or waiting 5 days for the process to complete!
Alterantively type them in one by one

sudo gem install json json_pure erubis mime-types rspec hpricot mocha rubigen haml markaby mailfactory
sudo gem install rack

Lets install sake for the sake merb and dm tasks so we can stay on edge
sudo gem install sake
Does that bum out? In which case:
sudo gem install ParseTree—version 2.1.1
sudo gem install ruby2ruby—version 1.1.8

- Now we need to set up email using postfix
sudo apt-get install postfix
sudo dpkg-reconfigure postfix

- Sake tasks
sudo sake -i http://merbivore.com/merb-dev.sake
sudo sake -i http://datamapper.org/dm-dev.sake

sudo sake merb:clone
cd merb
sudo sake merb:install
sudo sake merb:install:plugins

If you want datamapper

Decide whether you are using mysql, postgres etc, i use mysql, so install mysql drivers:
install dependencies for data_objects:
sudo gem install addressable
sudo gem install english

sudo sake dm:clone
cd dm
sudo sake dm:install

- Mysql
sudo apt-get install mysql-server
Default socket for mysql rails
sudo ln -s /tmp/mysql.sock /var/run/mysqld/mysqld.sock

God monitoring
http://www.thewebfellas.com/blog/2008/2/12/a-simple-faith-monitoring-by-god

and the god init script for ubuntu
http://log.openmonkey.com/post/36103083/god-init-script-for-debian-ubuntu-systems

Very important don’t forget:
sudo apt-get install libmysqlclient15-dev


nogeek.org is Digg proof thanks to caching by WP Super Cache!