EDIT: TO INSTALL MYSQLITE AND SQLITE3 USE THE FOLLWING:
yum install mysql-server mysql-libs mysql-devel yum install sqlite sqlite-devel
THIS INSTALLS THE LIBRARIES
gem install sqlite3-ruby
THIS INSTALLS THE GEM
The steps to setup/deploy your rails application on a rackspace cloud server are given below. The steps given below worked for me. Along with the steps I am also putting up screenshots where I think they are necessary.
- Login to the control panel of your account.
- On the screen that appears after successful login, on the left habd side, click HostingàCloud Servers àAdd server
- Then select the Operating system that you want.I selected fedora 14 and steps given below are for fedora 14.
- Then select the type of RAM/Disk and fill in credentials like name etc.
- Then you will see a screen like this:
Now you are ready to go.Now we need to setup rails on our server.You an click on console above and get started.My suggestion would be to use a ssh client like puTTy which can be downloaded from here.
- Install the linux dependencues and required libraries:
zlib zlib-devel openssl openssl-devel git expect pcre pcre-devel readline-devel mysql mysql-devel libxml2 libxml2-devel libxslt libxslt-devel
- To install ruby 1.9.2 use the following snippet:
- tar -xvf ruby-1.9.2-preview3.tar.gz
- cd ..
Done.This will install ruby 1.9.2 in your system(server).To check type the following at the terminal:
- To install rubygems use the following (I installed version 1.3.7 and then updated it)
- The latest version can be downloaded from This link
- cd ..
This should install rubygems to the system.
To update it, use
gem update –system
- To install rails use the simple command
gem install rails
this will install rails 3 in your system.
- Create a directory and make a blank rails application:
- mkdir my_sample_rails_apps
- cd my_sample_rails_apps
- rails new test1
- This will create a blank rails app.Now we can transfer an exisiting rails app using githhub.
To use github,we must have an account there.
- In the new system, create a ssh key using:
ssh-keygen -t rsa -C
- Now we can copy our project from github to our server using:
now the whole project is in a directory called ‘your_project’(replace it with the name of your project)
- Go in that directory using cd and then type :
AND THE MAGIC BEGINS
I WILL BE COVERING HOW TO MIGRATE DATABSES AS GITHUB DOES NOT MIGRATE DATABSES IN THE NEXT POST.(COMING SOON)