Category Archives: rails

On this page:
  • Setting up Ruby on Rails on a Redhat Enterprise Linux Rackspace Cloud Server
  • RoR: “What’s in My Fridge” now has a shopping list
  • More Rails twiddling
  • Girl!

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

RoR: “What’s in My Fridge” now has a shopping list

I know, I know, it’s silly, but it’s also so much fun programming little toys like this!

I’m also sketching out a life tracker that does something like Erik Benson’s Morale-o-Meter.

On Technorati: ,

More Rails twiddling

My “What’s in My Fridge” app is now a little bit smarter. It can keep track of what’s still in my fridge, what I’ve used, and what I’ve thrown away. I wonder if this will let me come up with statistics on how quickly I go through certain ingredients…

Random Japanese sentence: ねこはひなたで遊ぶのが好きだ。 Cats like playing in the sun.

Girl!

I play around with Ruby on Rails, and what do I do?

Build one webapp to keep track of what’s in my fridge, and another
webapp to keep track of what’s in my closet.

I’m going to do it in _pink_, too… ;)

On Technorati: , ,

Random Japanese sentence: 猫は鳥めがけて飛び跳ねた。 The cat sprang at the bird.