How to install Rails 3 with MySql on OpenSuse

I had some trouble installing Rails3 on OpenSuse. Then I thought to write some notes for the steps.

NOTE: If zypper does not find some library, use “” to find it.

First install rails (I’ll assume that you already have ruby installed from Yast)

sudo gem install rails

Unfortunately this is not enough: make sure you have correctly installed mysql.

sudo zypper install mysql mysql-devel

At this point, launching the server, we find that it does not work, because it still requires one step: Install NodeJs

sudo zypper install nodejs nodejs-devel

It 's all: let’s try it:

rails new bookmark_manager -d mysql
cd bookmark_manager/
vim config/database.yml (if necessary, to enter the password)
rake db:create 
rails generate scaffold bookmark url:string title:string description:text
rake db:migrate
rails server

Have fun!

BTW there is devel:languages:ruby:extensions repository [1] in OBS so you can install Rails3 using zypper from that repo. There are also many rubygems useful for Rails application development…

[1] Index of /repositories/devel:/languages:/ruby:/extensions (pick a subdirectory according to your SUSE version)