Skip to content

Getting Started with IP Database

amalvagomes edited this page Nov 6, 2012 · 9 revisions

Configure Your Development Environment

This project depends on Ruby and Rails. Let's get you set up.

Ubuntu 12.04 LTS

Curl will help our installer download the dependencies.
sudo apt-get install curl

Git will work wonders for us in the near future.
sudo apt-get install git

Let's get your git configured.
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"

Now we'll need to get mysql.
sudo apt-get install mysql-client
sudo apt-get install mysql-server

Now we'll get RVM which will manage all of the different versions of Ruby that can be installed in your environment. It will also fetch gem for us and let us manage gemsets.
curl -L https://get.rvm.io | bash -s stable --ruby

As soon as this script finishes, it will tell you to run a source command that puts rvm in your shell path. Run that command and then use which to check that it succeeded. Ubuntu doesn't come with zlib installed, so we'll use rvm to fetch that for us.
rvm pkg install ree_dependencies

After this finishes, it will give you two commands to run that will recompile all of the gem currently installed. For us, this should be only about three.

Now, we'll install our ruby.
rvm install 1.9.3

After this, we can start setting up our gemsets.
rvm gemset create ip; rvm use @ip

Clone The Repository

Let's download the repository and get to work!
git clone https://github.com/amalvagomes/ip-database.git

Branching Policy

  1. No commits to master
  2. No work-in-progress commits
  3. Branch from develop and work in your own branch until your feature is tested and complete
  4. Always pull from develop and resolve merge conflicts before making the final push to your branch
  5. Send pull requests to be merged into develop when you have made your final push

Running The App

Assuming you have created the mysql databases listed in config/database.yml, you'll just need to update the credentials in that file and then boot the app.

It's as simple as changing to the root directory of the repository and running this command!
rails server

Then just go to your web browser and visit http://localhost:3000/