Teach you how to start from scratch at install Ubuntu 8.10 on Ruby 1.8 Do you only want to be able to spend a few minutes at Ubuntu 8.10 installed on Ruby, RubyGems, and some commonly used gems?

You can use our In front of the log Mentioned in Passenger-Stack Automatically complete the installation. Of course, perhaps you prefer to do-it-yourself, step by step installation.

Installation steps are as follows:

First, install the basic system

apt-get update
apt-get -y install build-essential zlib1g zlib1g-dev libxml2 libxml2-dev libxslt-dev sqlite3 libsqlite3-dev locate git-core
apt-get -y install curl wget

Second, install ImageMagick

apt-get -y install libmagick9-dev

Three, install Ruby 1.8 (MRI)

apt-get -y install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby
ln -s /usr/bin/ruby1.8 /usr/bin/ruby
ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc
ln -s /usr/bin/irb1.8 /usr/bin/irb
ln -s /usr/bin/ri1.8 /usr/bin/ri

Note: there may be some people worried that the installation has been compiled ruby best performance, you can download at the official website of the compiler source code to install on their own.

Four, through the source code to install RubyGems

curl http://de.mirror.rubyforge.org/rubygems/rubygems-1.3.1.tgz | tar -xzv
cd rubygems-1.3.1 && ruby setup.rb install
cd .. && rm -rf rubygems-1.3.1
ln -s /usr/bin/gem1.8 /usr/local/bin/gem
gem sources -a http://gems.github.com # add Github as a gem source, you won't regret it

Friday, installing ruby gems Starter

gem install rake nokogiri hpricot builder cheat daemons json uuid rmagick sqlite3-ruby fastthread rack

What do I do?
So far we have successfully installed the ruby, ruby gems, if you only for ruby development, here you can, of course, if you are a rails developer, you have to install the gem install rails through the rails.
If you want to use apace hosting your procedures, then please continue to read down.

Optional: install Apache and Passenger

echo "deb http://apt.brightbox.net hardy main" > /etc/apt/sources.list.d/brightbox.list
wget -q -O - http://apt.brightbox.net/release.asc | apt-key add -
apt-get update
apt-get -y install libapache2-mod-passenger

If you need to run php5

apt-get -y install php5 libapache2-mod-php5 php5-mysql
/etc/init.d/apache2 restart

Optional: Install a very basic firewall

apt-get -y install ufw
ufw allow to 0.0.0.0/0 port 80
ufw allow to 0.0.0.0/0 port 22 # (or whichever port you use for ssh)
ufw allow to 0.0.0.0/0 port 25 # (if you need mail in)
ufw enable



The original English text: http://www.rubyinside.com/how-to-install-a-ruby-18-stack-on-ubuntu-810-from-scratch-1566.html



Chinese Source: Ruby-China