Posts

Showing posts with the label gem

How To Setup Ruby on Rails with Postgres

Postgres is a great open source database management system. It's pretty easy to use postgres with Ruby on Rails. Step 1: Install postgress in your system. If you already have postgres installed in your system then skip it else follow the  link . Step 2: Create new project rails new pg_demo You can also create using rails new pg_demo --database=postgresql Step 3: include the pg gem in your gem file gem 'pg' Step 4: run bundle command bundle Step 5: It will give you some error like An error occurred while installing pg (0.17.1), and Bundler cannot continue. Make sure that `gem install pg -v '0.17.1'` succeeds before bundling. So let's try to install the  pg gem first gem install pg It will again throw an error  :( Building native extensions.  This could take a while... ERROR:  Error installing pg: ERROR: Failed to build gem native extension.     /home/sabyasachi/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb checking for pg_config... y

Set up ruby 2.0 and Rails 4.0.1 in Rackspace

First we need to install ruby Step 1)Install Ruby apt-get -y update apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev cd /tmp wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz tar -xvzf ruby-2.0.0-p247.tar.gz cd ruby-2.0.0-p247/ ./configure --prefix=/usr/local make make install Step 2) Install Rails gem install rails 4.0.1 Step 3) Install passenger gem install passenger Step 4) Install Apache2 apt-get install apache2 Step 5) Install Mysql sudo apt-get install mysql-server mysql-client That's it we are done with the setup.