Ubuntu 10.04 setup for Ruby on Rails and general use

This extract is from notes I took during the process of setting up both a desktop and laptop for general use as a development environment for Ruby on Rails (RoR) and PHP development.

There were lots of other steps (custom gems and environment stuff I like), but most of what follows is generic enough to get the basics in place. Happy Hacking!!

Installing Skype

sudo apt-get install libqt4-dbus libqt4-network libqt4-xml libasound2
sudo dpkg -i skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb

Installing Amarok

sudo apt-get install xine-ui libxine1-ffmpeg

To get remote shares mapping in fstab.

Firstly, install the smb client package

sudo aptitude install smbfs
sudo apt-get install portmap nfs-common

Then add the following line to /etc/hosts.deny:

echo portmap : ALL>>/etc/hosts.deny

By blocking all clients first, only clients in /etc/hosts.allow below will be allowed to access the server.

Now add the following line to /etc/hosts.allow. User your own IP address.

echo portmap : 192.168.0.20>>hosts.allow

Next create the mounting points on your system

sudo mkdir /mnt/<name of mounting point>
sudo mkdir /mnt/music
sudo mkdir /mnt/backups

Create a file in home folder called .smbcredentials (note the leading dot)

touch ~/.smbcredentials
echo username=[your network username] >> ~/.smbcredentials
echo password=[your network password] >> ~/.smbcredentials
chmod 600 ~/.smbcredentials

Now an entry in /etc/fstab using the ip address of your NAS

#Added a permanent share to shares on NAS box
#Note: everything that follows (up to the 0  0 should appear on the one line)
#and one line is required for each share you want to map

//192.168.0.20/<foldername on NAS> /mnt/<local foldername> cifs
uid=peter,credentials=/home/peter/.smbcredentials,domain=office,dir_mode=0777,file_mode=0777 0       0

Now, for a few of the other standard tools
Setup filezilla and limewire

sudo aptitude install filezilla

#Limewire - download LimeWireLinux.deb from limewire site
# reports missing dependencies
sudo dpkg -i LimeWireLinux.deb
limewire-basic depends on sun-java6-jre | icedtea-java7-jre |
sun-java6-jdk | icedtea-java7-jdk; however:
Package sun-java6-jre is not installed.
Package icedtea-java7-jre is not installed.
Package sun-java6-jdk is not installed.
Package icedtea-java7-jdk is not installed.
dpkg: error processing limewire-basic (--install):
dependency problems - leaving unconfigured

Open synaptic package manager. Go to the Settings/Repositories/Other sources tab.
Check the two default partner sites. Reload the package list and select the following

sun-java6-jre
sun-java6-plugin
sun-java6-fonts packages

Now retry limewire and you’re smoking.

Installing ruby and associated gems

sudo apt-get install ruby
sudo apt-get install rubygems
sudo gem install rake
sudo gem install rails

I tried to install capistrano using sudo but it wasn’t working on laptop however it did work on desktop

gem install capistrano

Then change ~/.bashrc to include path to new gems

emacs ~/.bashrc &
export PATH=$PATH:~/.gem/ruby/1.8/bin:/var/lib/gems/1.8/bin

Now install and configure mysql before trying to install any of the ruby mysql gems

install mysql server
sudo apt-get install mysql-server

Setup prompts you for a password – enter it, remember it and enter it again.

Install the mysql admin tools

sudo apt-get install mysql-admin

NB – must install the libmysqlclient[nn]-dev package
This has mysql_config bundled with it which is needed by the ruby gems

Execute the following to find out what version of libmysqlclient you’re running

dpkg --get-selections | grep mysqlclient

In my case it’s version 16, so execute the following

sudo apt-get install libmysqlclient16-dev

Next, you NEED TO INSTALL the ruby1.8 dev package
If you don’t you’ll get all sorts of mysql gem errors — frustrating!!!

sudo apt-get install ruby1.8-dev
sudo gem install mysql

Installing and configuring git

sudo apt-get install git-core
git config --global user.email

Installing apache

sudo apt-get install apache2

The line above should do it, if you get any glitches, try the following

sudo apt-get install apache2.2-bin
sudo apt-get install apache2.2-common
sudo apt-get install apache2-threaded-dev

Installing php

sudo apt-get install php5
sudo apt-get install php5-mysql

Anything else is stuffing around with particular ruby gems and dev tools so probably too specific for this note.

  • Share/Bookmark

No Responses to “Ubuntu 10.04 setup for Ruby on Rails and general use”

Leave a Reply



Spam protection by WP Captcha-Free