Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Thursday, March 25, 2010

ruby on rails installation on fresh ubuntu machine

by sandipransing 0 comments

Ruby On Rails Installation on fresh ubuntu machine

Installation steps are applicable to ubuntu versions interpid, karmic koala. Make necessary changes according to package manager provided by other linux operating systems in order install ruby and rails.

Before getting started to installations make sure to build essential packages on fresh ubutnu machine. Ubuntu machine has built in apt-get package manager and that i loves because it is very to use as compared to other OS.
sudo apt-get install build-essential

Now there are many versions of ruby available including latest 1.9.2
But would like to prefer ruby version 1.8.7 as it is the most stable version as of now. I would like to recommend installtion of Ruby Enterprise Edition (REE) version as it is uses minimal system resources and consumes less memory.

Instrunctions to setup normal ruby and rails environment


1. Install Ruby, Rails, MySQL, irb and neceesary packages using single command
sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client-5.1 mysql-common mysql-server-5.1 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8 libhtml-template-perl mysql-server-core-5.1 libmysqlclient16 libreadline5 psmisc
2. Install ruby gems
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xvzf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb
3. Create symbolic links to installation paths
sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb
4. Setup gemrc in order to avoid rdoc installation and to setup gem sources.
Add following lines to ~/.gemrc file
---
gem: --no-ri --no-rdoc
:benchmark: false
:verbose: true
:backtrace: false
:update_sources: true
:sources:
- http://gems.rubyforge.org
- http://gems.github.com
:bulk_threshold: 1000
5. Install rails
sudo gem install rails --no-rdoc --no-ri

Ruby Enterprise Edition i.e. REE (ruby 1.8.7) Installation


This will install ruby, rails, mysql, nginx and passenger

1. Download REE setup and install it
wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz /opt/ruby

cd /opt
./ruby/installer

2. Add ruby inside path
vi ~/.bashrc
# Add following line at the end of file
export PATH=/opt/ruby/bin:$PATH

Thanks to @vwadhwani!
Read More…

Tuesday, March 23, 2010

Download Rails API to work offline

by sandipransing 0 comments
Command to download/copy rails api to work locally(offline) mode.
wget -mk www.api.rubyonrails.org
For more information click
Read More…

Imagemagick/ RMagick Installation on ubuntu

by sandipransing 0 comments

ImageMagick Installation

Ubuntu machine has default apt-get package manager.
To install imagemagick following packages needs to be installed.

apt-get install imagemagick librmagick-ruby libmagickwand-dev

RMagick gem install

gem install rmagick

If you still facing problems with gem installation, Please look that following packages are installed
on your system.

dpkg -l | grep libmagickcore-dev graphicsmagick-libmagick-dev-compat

If there are no packages installed then try to install then first.

apt-get install libmagickcore-dev graphicsmagick-libmagick-dev-compat

Try to install rmagick gem again. Now it should be installed without any error.

Read More…

Friday, March 12, 2010

WordPress blog software installation

by sandipransing 0 comments
WordPress is a open source software developed by and for community with ongoing development on it.
Easy installation, customizable, with lots of available plugins, themes and SEO friendly are the strengths of it!
Software is mainly serves the purpose of blogging, hosting static websites.
People with knowledge of php, javascipt and little knowledge of mysql db can customize it however they want.

Minimum server requirements
  1. PHP 4.3 or greater
  2. MySQL 4.1.2 or greater
  3. apache/ngnix ( or any web server supporting php & mysql )

For detailed information on installation click

Now you will need to decide where on your web site you'd like your blog to appear:
In the root directory of your web site. (For example, http://yoursite.com/)
In a subdirectory of your web site. (For example, http://yoursite.com/blog/
This can be done by adding new route at nginx configuration file or deploying wordpress
software inside blog directory of main website.

There are millions of satisfied users using word-press blog.
To create and start blogging with free wordpress.com blog click


WordPress MU multiblog software provides a way to create thousands of wordpress blogs
just like wordpress.com site does.

Download and detailed information on installation click

Read More…

Monday, December 14, 2009

Getting wired and wireless working on ubuntu 9.0.4

by sandipransing 0 comments
It might be the case that earlier wireless was working and then it stopped working
Follow the simple steps here....
1. Restart networking
sudo /etc/init.d/networking restart
2. Disable the "Support for Atheros 802.11 wireless LAN cards" on system/administration/Hardware Drivers, and reboot your box.
3. Restart
sudo reboot

That's it, Cheers! Still having problem follow the instructions here
Read More…

Sunday, November 15, 2009

pidgin install and update pidgin messenger on ubuntu interpid

by sandipransing 0 comments
Fresh pidgin Installation
 sudo apt-get update
 sudo apt-get install pidgin
Earlier versions of pidgin has problem in connecting yahoo messenger which is solved in newer versions.
In order to update old version of pidgin, simply follow instructions written below and you are done.
New version provides video and voice chat, also buddy icon improvements are added.

Add GPG key
 sudo apt-get update
 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1F196A8
Goto System > Administration > Software Sources and select Third-Party Software tab and click ADD. And Simply Copy-Paste the following Repo
deb http://ppa.launchpad.net/pidgin-developers/ppa/ubuntu intrepid main 
deb-src http://ppa.launchpad.net/pidgin-developers/ppa/ubuntu intrepid main
Read More…

Monday, October 12, 2009

Feedzirra installtion on ubuntu interpid

by sandipransing 0 comments
Feedzirra is a feed library that is designed to get and update many feeds as quickly as possible. This includes using libcurl-multi through the taf2-curb gem for faster http gets, and libxml through nokogiri and sax-machine for faster parsing.
sudo apt-get install libcurl3 libxml2 libxml2-dev libxslt1-dev


sudo gem install pauldix-feedzirra

Read More…

Tuesday, September 29, 2009

jruby rails installation on ubuntu interpid

by sandipransing 1 comments
# install mysql if you dont have already installed
sudo apt-get install mysql-server mysql-client libhtml-template-perl mailx dbishell libcompress-zlib-perl mysql-doc-5.0 tinyca

# install ant and jdk
sudo apt-get install ant sun-java6-jdk

# install jruby
mkdir software
cd software
wget http://dist.codehaus.org/jruby/jruby-bin-1.1.5.tar.gz
tar xvfz jruby-bin-1.1.5.tar.gz
ln -s jruby-1.1.5 jruby
export PATH=$PATH:$HOME/software/jruby/bin

# install the version of rails wanted by jruby
jruby -S gem install jruby-openssl
jruby -S gem install rails

# list your gems
jruby -S gem list

# install the gems needed for db
jruby -S gem install activerecord-jdbc-adapter activerecord-jdbcmysql-adapter

# generate some code
cd ~/scripts/ruby
jruby -S rails wherehaveyoubeen -d mysql
cd wherehaveyoubeen
jruby script/generate controller states index

# configure access to the database server
vi config/database.yml

#development:
# adapter: jdbcmysql <- very important!
# encoding: utf8
# database: test_development
# username: root
# password: database
# socket: /var/run/mysqld/mysqld.sock

# generate the db
jruby -S rake db:create:all
jruby -S rake db:migrate


# edit your app
sudo apt-get install emacs ruby-elisp irb1.8 emacs22-el
emacs -bg black -fg wheat app/views/states/index.html.erb

# uncomment the secret in app/controllers/application.rb
vi app/controllers/application.rb

# run your app
jruby script/server
Read More…

Installing ruby 1.9.1

by sandipransing 0 comments
installing ruby 1.9.1 is very easy .......
follow simple steps

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

tar -xvf ruby-1.9.1-p0.tar.gz

cd ruby-1.9.1-p0
./configure

make
make test
sudo make install


Thats, it !
Read More…

Wednesday, May 13, 2009

Working with multiple ruby versions on same server

by sandipransing 1 comments
click for original postNice post by Michael Greenly

I recently changed how I'm handling multiple simultaneous Ruby installations and I'd like to share.

What I needed was to make it convenient to switch between the system provided packages and specific, from source, installations. After some experiments I decided to use 'update-alternatives' to do it.

Here's a quick walk through...

First I removed all of my Ruby and RubyGem environment variables, they're not needed.

Then I installed Ubuntu's default Ruby packages via apt-get.

$ sudo apt-get install ruby irb ri rdoc libruby-extras rubygems ruby1.8-dev


Next I downloaded and installed alternate versions of Ruby from source. In this example I'm going to use two additional versions; the newest stable release and the newest development release.

$ cd /tmp
$ wget -c ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p71.tar.gz
$ tar -xvzf ruby-1.8.7-p71.tar.gz
$ cd ruby-1.8.7-p71
$ ./configure --prefix=/opt/ruby-1.8.7-p71
$ make
$ sudo make install
$ wget -c ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-3.tar.gz
$ tar -xvzf ruby-1.9.0-3.tar.gz
$ ./configure --prefix=/opt/ruby-ruby-1.9.0-3
$ make
$ sudo make install


At this point I have three versions of Ruby installed and each can be accessed through it's full path.

$ /usr/bin/ruby --version
# ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
$ /opt/ruby-1.8.7-p71/bin/ruby --version
# ruby 1.8.7 (2008-08-08 patchlevel 71) [i686-linux]
$ /opt/ruby-1.9.0-r18217/bin/ruby --version
# ruby 1.9.0 (2008-07-25 revision 18217) [i686-linux]


You'll also notice that the default installation is the one provided by Ubuntu.

$ ruby --version
# ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]


Next we'll use 'update-alternatives' to make it a bit easier to switch between them. You could do this on the command line but it becomes a fairly long nasty command so I found it easier to write a quick shell script and run it. The script:

update-alternatives --install \
/usr/local/bin/ruby ruby /usr/bin/ruby 100 \
--slave /usr/local/bin/erb erb /usr/bin/erb \
--slave /usr/local/bin/gem gem /usr/bin/gem \
--slave /usr/local/bin/irb irb /usr/bin/irb \
--slave /usr/local/bin/rdoc rdoc /usr/bin/rdoc \
--slave /usr/local/bin/ri ri /usr/bin/ri \
--slave /usr/local/bin/testrb testrb /usr/bin/testrb

update-alternatives --install \
/usr/local/bin/ruby ruby /opt/ruby-1.8.7-p71/bin/ruby 50 \
--slave /usr/local/bin/erb erb /opt/ruby-1.8.7-p71/bin/erb \
--slave /usr/local/bin/gem gem /opt/ruby-1.8.7-p71/bin/gem \
--slave /usr/local/bin/irb irb /opt/ruby-1.8.7-p71/bin/irb \
--slave /usr/local/bin/rdoc rdoc /opt/ruby-1.8.7-p71/bin/rdoc \
--slave /usr/local/bin/ri ri /opt/ruby-1.8.7-p71/bin/ri \
--slave /usr/local/bin/testrb testrb /opt/ruby-1.8.7-p71/bin/testrb

update-alternatives --install \
/usr/local/bin/ruby ruby /opt/ruby-1.9.0-r18217/bin/ruby 25 \
--slave /usr/local/bin/erb erb /opt/ruby-1.9.0-r18217/bin/erb \
--slave /usr/local/bin/gem gem /opt/ruby-1.9.0-r18217/bin/gem \
--slave /usr/local/bin/irb irb /opt/ruby-1.9.0-r18217//bin/irb \
--slave /usr/local/bin/rdoc rdoc /opt/ruby-1.9.0-r18217/bin/rdoc \
--slave /usr/local/bin/ri ri /opt/ruby-1.9.0-r18217/bin/ri \
--slave /usr/local/bin/testrb testrb /opt/ruby-1.9.0-r18217/bin/testrb


What that does is create a group of applications under the generic name Ruby. In addition each application has several slave applications tied to it; erb, irb, etc... In defining each application we specify what symbolic link it will be accessed through and where the application is actually installed. In my case Ubuntu installed Ruby in /usr/bin and the source installed versions are in /opt. All of the installations will be accessed through the generic name Ruby and will have there symbolic links created in /usr/local/bin. I choose /usr/local/bin because it supercedes /usr/bin in the default path.

Before moving on make sure that 'update-alternatives' sees all of our Ruby installations:

$ update-alternatives --list ruby
# /opt/ruby-1.9.0-r18217/bin/ruby
# /opt/ruby-1.8.7-p71/bin/ruby
# /usr/bin/ruby


Now switching between them is as easy as running the 'update-alternatives' command and selecting the number of the installation you'd like to use. Example:

$ sudo update-alternatives --config ruby


It's important to keep in mind that each installation is separate. So for example if you install RubyGems while using /usr/bin/ruby it will not be available to /opt/ruby-1.9.0-r18217/bin/ruby, or /opt/ruby-1.8.7-p71/bin/ruby, etc....

While it's probably possible to use a shared repository for RubyGems across multiple installations I haven't tried it and instead have choosen to use multiple separate RubyGem installs, one for each Ruby installation.

Also RubyGem's bindir will most likely not be in your path. To get around this I created a short script called 'gemexec' in /usr/local/bin

#!/usr/bin/env ruby

require 'rubygems'

if ARGV.size > 1
exec "#{Gem.bindir}/#{ARGV.shift}",ARGV.join(" ")
else
exec "#{Gem.bindir}/#{ARGV.shift}"
end


This script uses the RubyGems installation of the currently selected Ruby to determine where the executable gem should be found, then runs it with any additional command line arguments provided. example:

$ gemexec rake --version
# rake, version 0.8.1


With all that in place the only thing to watch out for is other peoples scripts that hardcode the shebang line with something like "#!/usr/bin/ruby". What I do myself, and prefer in general, is to use "#!/usr/bin/env ruby".
Read More…

Ruby 1.8.7 and rails installation on ubuntu interpid

by sandipransing 1 comments
Execute following commands in order to install ruby and rails.

sudo apt-get install build-essential

Below command will install all necessary packages.
if you dont want any remove it from command.

sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client-5.0 mysql-common mysql-server-5.0 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8 libterm-readkey-perl psmisc

Gem Installation
Please find latest stable gem version on rubyforge.

wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar xvzf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo ruby setup.rb


And last to install rails without documentation

sudo gem install rails --no-rdoc --no-ri

and finally rails server, you can install apache mongrel, nginx + thin, whichever you feel suitable.

for mongrel install

sudu gem install mongrel
Read More…

About The Author

Sandip is a ruby on rails developer based in pune and also a blogger at funonrails. Opensource contributor and working with Josh software Private Limited. for more info read Follow Sandip on Twitter for updates.

Connect With Me...

Github Projects

@sandipransing Twitter