“Learning Rails”

Posted by Piyush Gupta on July 19, 2010

We all use Agile web development , ruby for rails, rails in 4 days, ruby , ajax etc books to get a hang of ruby on rails also some more books like pragmatic etc .

However I thought of making a list of websites which help do so

So here is the bunchedin : http://www.bunchedin.com/vuIMCc

“Installing ImageMagik on Unix/Linux” 1

Posted by Piyush Gupta on July 15, 2010

Follow the below steps

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz

Next configure and compile ImageMagick:

tar xvfz ImageMagick.tar.gz
cd ImageMagick-6.6.3
./configure
make

If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type

sudo make install

Finally, verify the ImageMagick install worked properly, type

/usr/local/bin/convert logo: logo.gif

For a more comprehensive test, run the ImageMagick validation suite. Ghosts cript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail.

make check

Reference : http://www.bunchedin.com/aOqNOv

“Ruby On Rails environment on Ubuntu 10.04

Posted by Piyush Gupta on June 22, 2010

I think this is my first technical post in the blog, so today I faced some problems while building the Ruby on Rails environment on my machine. I just like sharing this knowledge with you.

First, in this post we will make the following:

1. Ruby 1.9.1
2. Rails 2.3.5
3. Thin server.
4. MySQL server.

1. Ruby 1.9.1
The following commands mainly download the Ruby source code and compile it and so on

Just you have to install the following libraries:

sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev

move to /usr/local/src to download source code and compile it in this folder
cd /usr/local/src

Download the source code, and unpack it

sudo wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.gz
sudo tar xzf ruby-1.9.1-p0.tar.gz
cd ruby-1.9.1-p0

Now, you have to check the version of gcc if it is 4.4 some errors will occur

dpkg -l | grep gcc

if gcc 4.4 found then you have to edit the cont.c file to go on. Open it up, and change the lines 90, 270 and 317 from #elif to #else.

sudo gedit cont.c

then write the following commands in terminal

sudo ./configure –prefix=/usr/local/ruby-1.9.1
sudo make
sudo make install

After these steps you have finally installed Ruby 1.9.1, to check its version

cd /usr/local/ruby-1.9.1/bin
ruby -v
output like that: ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]

Now, the ruby commands such as ruby, rake, irb, … etc are accessed only from /usr/local/ruby-1.9.1/bin, and all the commands are found in /usr/local/bin so just make link for the commands in ruby-1.9.1/bin and put them in /usr/local/bin

sudo ln -s /usr/local/ruby-1.9.1/bin/ruby /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/rake /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/gem /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/irb /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/ri /usr/local/bin
sudo ln -s /usr/local/ruby-1.9.1/bin/rdoc /usr/local/bin

2. Rails 2.3.5
Now, Ruby 1.9.1 is installed successfully on your machine, just add this command to terminal to install the Rails 2.3.5 gem

sudo gem install rails -v=2.3.5

3. Thin server
Also to install Thin application server gem

sudo gem install thin

4. MySQL server
Finally to install MySQL server for DB

sudo apt-get install mysql-server
and while installing it is required to set the root password

References: http://www.bunchedin.com/8Bolx6

Hope that it is some how useful for you