SquidBlackList - the world's largest porn blacklist! HAX Radio - The stream the FBI Listens to! Offensive Security Wireless Professional PWNIE 2012 Nominations The Hip-Hop Realm

Archive for the ‘Ruby’ Category

Ruby Rails on Debian Squeeze

Tuesday, January 11th, 2011

I started learning Ruby a while ago, but never got into Rails. When I finally decided to install and use Rails, man, I ran into a ton of errors! The error message you see below, confused me for about 10 minutes this morning – lack of coffee?

Could not find gem 'sqlite3-ruby (>= 0, runtime)' in any of the sources. and would not run my rails server on port 3000.

Then I tried to use gem and bundle to install sqlite3-ruby but got these errors stating that my sqlite3 libraries (you know, all that stuff that gets thrown into either /usr/lib or /usr/local/lib ?) were old :(

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

Well, the only version in aptitude is 3.6.1 er something. So we will have to compile via source code! Here is my quick fix, remove the aptitude precompiled version of sqlite3-ruby and sqlite.

apt-get remove sqlite3-ruby sqlite3

Then, install Rails env:

apt-get install ruby rails rubygems
gem1.8 update

Next we are going to install the latest sqlite3 via source!

apt-get build-dep sqlite3
tar vvvvvxzf sqli*
cd sqli* && ./configure
make && make install
cp /usr/local/lib/libsqlite3.* /usr/lib/

Now, install the Ruby gem to interact with your shiny new SQLite3:

bundle install sqlite3-ruby

To test this, go into a directory accessible via the web, like the Apache2 default “/var/www/” and do:

rails new testapp
./testapp/scripts/rails server

and point yer browser to your website (or localhost) at port 3000. You should then see this, if all went well: