6093 comments
2357 subscribers
6238 on Twitter
Subscribe! Feed reader E-mail

Setting up Ruby on Rails on a Redhat Enterprise Linux Rackspace Cloud Server

1. Compile Ruby from source.

First, install all the libraries you’ll need to compile Ruby.

yum install gcc zlib libxml2-devel 
yum install gcc
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel

My particular application has problems with Ruby 1.9.2, so I compiled Ruby 1.8.7 instead. This can be downloaded from ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz

Unpack the source code for Ruby. Configure and install it with:

./configure
make
make install

Add /usr/local/bin to the beginning of your PATH.

2. Install Ruby Gems.

Downloadcd the latest Ruby Gems package and unpack it. I got mine from http://production.cf.rubygems.org/rubygems/rubygems-1.7.1.tgz . Change to the directory and run:

ruby setup.rb

3. Install Rails and rake

gem install rails rake

If all goes well, you should now have Rails and rake.

Troubleshooting:

*builder-2.1.2 has an invalid value for @cert_chain*

Downgrade Rubygems to version 1.6.2 with the following command.

gem update --system 1.6.2

(Stack Overflow)

sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!

Compile sqlite from source:

wget http://www.sqlite.org/sqlite-amalgamation-3.7.0.1.tar.gz
tar zxvf sqlite-amalgamation-3.7.0.1.tar.gz
cd sqlite-amalgamation-3.7.0.1
./configure
make
make install
gem install sqlite3

LoadError: no such file to load – openssl

  1. Install openssl and openssl-devel.
    yum install openssl openssl-devel
    
  2. Go to your Ruby source directory and run the following commands:
    cd ext/openssl
    ruby extconf.rb
    make
    make install
    

LoadError: no such file to load – readline

yum install readline-devel

Change to your Ruby source directory and run the following:

cd ext/readline
ruby extconf.rb
make
make install

(Code snippets)

You can’t access port 80 from another computer.

Port 80 (the web server port) is blocked by default on Redhat Enterprise Linux 5.5. Edit /etc/sysconfig/iptables to allow it, adding a line like:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

Make sure you put it above the REJECT all line.

Load your changes with

/etc/init.d/iptables restart

(Cyberciti)

2011-04-04 Mon 11:06

Short URL: http://sachachua.com/blog/p/22184

On This Day...

  • 2013: Understanding my procrastination — This week’s Less Wrong Toronto rationality challenge was about procrastination: observing how, why, and when you procrastinate, and what you [...]
  • 2012: Unstructured time update, now that I have my own business — I like making lists of things I can do to make the most of chunks of time. Lists make it [...]
  • 2011: The Busy Person’s Guide to Learning from the Network (a guide for IBMers) — I promised to put together a talk on learning for an IBM virtual conference for new hires. Here’s a rough [...]
  • 2010: Unstructured time update — I’m going to find out if all that cooking we did last weekend will get us through this week and [...]
  • 2009: Managing virtual assistants: the surprising benefits of transcription — I frequently give speeches. During some months, practically every week involves a presentation or two. I usually post presentation, recording, [...]
  • 2007: I miss my family — The only way to keep sane is to not wish that I was somewhere else, but I really really miss my [...]
  • 2006: Grill time! — Toastmasters from 6 to 8 means I usually can’t meet anyone for dinner on Tuesdays, which is why I was surprised [...]
  • 2006: Helping people find their voice — One of my friends scoffs at Toastmasters, but moments like this make it definitely worthwhile. Today one of the members brought his [...]
  • 2006: Backlog: Web 2.0 — Also, _totally_ cool Web 2.0 conference yesterday. Will blog more about it soon. On Technorati: nextweb Random Japanese sentence: 私が出掛けている間、猫の面倒をみてください。 Please look after [...]
  • 2006: Backlog: Lasagna — Shared lasagna and vegetable stew with Mike Tsang last night. This informal potluck dinner thing is working out quite well… Random Japanese [...]
  • 2006: Backlog: Lasagna — Shared lasagna and vegetable stew with Mike Tsang last night. This informal potluck dinner thing is working out quite well… Random Japanese [...]
  • 2003: Week summary view — Cross-reference: PlannerMode#4
  • 2003: NealStephenson uses Emacs! — Alan Shutko on debian-user@lists.debian.org links to http://hobbes.ncsa.uiuc.edu/nealstephensonOS.html . Coooool. Well, as if the OrdoEmacs reference in Cryptonomicon wasn’t a giveaway… NealStephenson is cool.
  • 2003: Emacs tips — EmacsWiki:ProgrammingEffectivelyWithEmacs has a lot of productivity-boosting tips. In particular, it links to a Kuro5hin article about making Emacs stand up [...]
  • 2003: Cards — Another cool project can be found at http://cards.sourceforge.net . It was started by Sam Watkins, one of my friends and an [...]
  • 2003: Hacking Society — On the compsci mailing list, Migz Paraz mentions the Hacking Society, a pretty cool idea. I’d love a real-life space like this. Currently, [...]
  • 2003: Another cat link — - http://www.sniksnak.com/cathealth/howto10.html
  • 2003: Gender stereotypes in CS — Susan Fox (SIGCSE) has a student double-majoring in CS and Psychology. From the message: A part of her project is collecting [...]
  • 2003: I hate floppies. — This is the Nth bad sector that I’ve come across. It’s starting to get a little annoying.
  • 2003: More puzzles — The anonymous person from 2003.02.26#6 contributes another puzzle link: http://www.claymath.org/Millenium_Prize_Problems/ . This one has heavier problems with big cash prizes.
  • 2003: Graduate school deadline — The deadline for applying to the graduate school of education in Ateneo is the second week of May, or 2003.05.05.
  • 2003: Yesterday’s CS party — Yesterday I had a thanksgiving party for the computer science faculty and staff. People who went: Dr. Vergara, Dr. Manalastas, Sir [...]

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging

Free sample!