Installing sqlite3-ruby in Mandriva and Rails 2.0.2

Problem
After upgrading to Rails 2.0.2 when trying to install the sqlite3-ruby gem got the following error:

ERROR:  Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb install sqlite3-ruby
checking for sqlite3.h... no
make
make: *** No rule to make target `ruby.h', needed by `sqlite3_api_wrap.o'.  Stop.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.1/ext/sqlite3_api/gem_make.out

Solution
In Mandriva you need to install the ruby-sqlite3 and the development libraries first, like:

sudo urpmi ruby-sqlite3
sudo urpmi libsqlite3-devel

After that you should be able to install the gem as normal.

Checking out a remote CVS project

Problem
You want to use cvs to checkout a repository from a remote server.

Solution
If you were using subversion it would be very simple to do by using the remote url.
In CVS you have to to do the following:
First find out where the cvsroot in the remote server is. We will assume for this example that is located in /usr/local/cvsroot.
Then run the following on your local linux pc:

export CVSROOT=:ext:user_name@remote_pc:/path_to_csvroot export
export CVS_RSH=ssh

You then should be able to do a checkout by typing the following and supplying your password:

cvs checkout project_name

Password – less logins and aliases with ssh

Problem
You want to be able to login to different servers with ssh, but don’t want to be using your password every time.

Solution
We assume that you already have installed ssh and have created ssh public keys in your local machine.

  1. Run the following in your local machine:
    ssh-copy-id -i ~/.ssh/id_rsa.pub user_name@remote_host
  2. If you want to add aliases in your bash profile so you don’t have to type the whole address of the remote host, edit your .bashrc and add:
    alias short_name="ssh user_name@remote_host"
  3. Restart your X server, or simply start a new terminal session
  4. You should be able to login with ssh without using your password by typing in your command prompt in your local machine:
    short_name