Skip to end of metadata
Go to start of metadata

Pre-requisites

CentOS doesn't ship with proper ruby support, especially not with RoR. So let's do it properly – from scratch.
This will with slight modifications work on other Linux environments as well.

Before we go ahead with the installation from source, let's install some pre-requisites (including development headers):

  • GCC
  • make
  • OpenSSL
  • Curl
  • Expat
  • Gettext
  • and MySQL support
yum install zlib-devel curl-devel expat-devel gettext-devel \
      mysql-server mysql-devel openssl-devel gcc make

On Debian or SuSE this step will differ, the rest of this short manual won't.

Installation

Getting the Source

That is quite difficult nowadays, as the main site rubyforge.org is more down than up, and the official mirror list is hidden on that page, of course

So, let's make it easy (finding these mirrors with recent versions took me ages!):

curl -O http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
curl -O http://rubyforge.vm.bytemark.co.uk/files/rubygems/rubygems-1.3.5.tgz

Installing Ruby

That's what we need to get started. Unpack both, then go into the ruby directory first. There, call:

./configure
make
make install

Now, one oddity: Ruby won't find zlib, unless you explicitly change one setting, which you can't without ruby. Don't ask
So let's change it and go ahead again:

cd ext/zlib
ruby extconf.rb --with-zlib-include=/usr/include --with-zlib-lib=/usr/lib
cd ../../
make
make install

There we go. Ruby is installed. Check it running ruby -v

Installing Ruby Gems

That's straight forward. Go into your rubygems directory and run:

ruby setup.rb

Afterwards you should be able to run gem list, which shows you an empty list.
To work-around the previously mentioned issues with rubyforge.org, change your remote repository:

gem sources -r http://gems.rubyforge.org/
gem sources -a http://gems.tron.name/gems.rubyforge.org/

(The existence of trailing forward slashes above DOES matter!)

Then you probably want MySQL support added to Ruby:

gem install mysql

This will throw a bunch of warnings. They are related to the documentation, not the library, so don't worry here.

Installing Ruby on Rails

gem install rails
For Redmine users
If you need Rails for Redmine, you need to specify a particular rails version:
gem install rails -v=2.1.2
This can co-exist with other versions of rails!

Afterwards, gem list will produce something like this:


*** LOCAL GEMS ***

actionmailer (2.1.2)
actionpack (2.1.2)
activerecord (2.1.2)
activeresource (2.1.2)
activesupport (2.1.2)
mysql (2.8.1)
rails (2.1.2)
rake (0.8.7)

That's it. Well done. Not that difficult after all, is it?

How about Redmine?

Now that you've got Ruby on Rails installed, how about Redmine as a Issue Tracker, Repository Viewer, Wiki and simple Project Management tool altogether?

I found the information on their website a bit confusing. So let me try to give you a straight-forward introduction to installing Redmine.

Let's grab the code first (you may need to run yum install subversion, if you haven't got an svn client running yet):

svn export http://redmine.rubyforge.org/svn/tags/0.8.5 /home/redmine
useradd redmine

Then open a MySQL shell with mysql -uroot, and run these commands:

create database redmine character set utf8;
grant all on redmine.* to 'redmine'@'localhost' identified by 'PASSWORD';
flush privileges;

Now create the file config/database.yml in your redmine directory (/home/redmine/config/database.yml in this example):

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: PASSWORD
  encoding: utf8

That was the preparation. We're almost there. In /home/redmine or wherever you put your redmine application, run

rake db:migrate RAILS_ENV="production"

Optionally you can add default data to the database (not examples, but enumerations, ticket flows etc):

rake redmine:load_default_data RAILS_ENV="production"

And finally, let's make sure we've got the right access levels set:

chown -R redmine:redmine /home/redmine
chmod -R o-rwx,g-rwx /home/redmine

That's it. Ready to kick off. Let's start webbrick:

su - redmine -c "ruby script/server webrick -e production"

And now you are ready to log in:

http://YOUR_SERVER_NAME:3000
user: admin, password: admin

Have fun

Shortcuts



Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.