Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Mac First Run

atomicrat2552 edited this page May 29, 2012 · 6 revisions

For this tutorial, the following is assumed:

  1. ~ points to your user directory
  2. $CLOUDSDALE points to the directory your local copy of Cloudsdale is in
  3. RVM is installed in ~/.rvm
  4. Neither RVM nor any Ruby executables are installed as root/sudo

Installing Git

Github has a great guide to setting up Git for OS X here. Make sure to use your preferred display name (generally either your Github username or your real name) as well as your Github email address for the final steps.

Installing Brew

Brew is going to be used to get all the neccessary native code for Ruby. The first thing you'll need is a C compiler. Normally, one would use Xcode for this, but Xcode 4.2 and later's llvm compiler is NOT fully supported as of Ruby 1.9.3 and can cause some issues with gems that rely on native extensions. You may attempt to use it if you like, but it's recommended to use either Xcode 4.1 and earlier with the commandline tools or OS X GCC.

10.5 Tiger

You should get Xcode and use it (Google is your friend on this one).

10.6 Snow Leopard and 10.7 Lion

You may use either Xcode 4.1 or earlier, or you may use OS X GCC from here. Simply download and run the file appropriate for your OS.

Install Brew

Now that you have a GCC compiler you can install Brew by pasting the following command into your terminal: /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

Installing RVM

Ruby Version Manager (RVM) is the easiest way to install, update and maintain your Ruby install. To install RVM, simply paste the following into your Terminal: curl -L get.rvm.io | bash -s stable --rails

Modifying your Bash profile so you can use RVM

Now that you have RVM installed, we're going to modify your Bash profile so you can use it from the commandline. Run nano ~/.bash_profile and make sure the line [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" is located in your file. If it isn't add it to the end of the file and. Press ^X to exit, choosing to save if you made any changes.

If you had any terminals open, either close and re-open them or use source ~/.bash_profile to make sure you can use RVM.

Installing Ruby 1.9.3

Cloudsdale currently uses Ruby 1.9.3, so we're going to make sure you have that installed. As of the time of writing, Ruby 1.9.3 is included as part of the RVM installer, but we're going to make sure you have it by running rvm install 1.9.3

Installing the required Brew packages

Some of the gems Cloudsdale uses require native extensions from Brew. To get them, run the following: brew install rabbitmq mongo node.js redis

Pulling Cloudsdale

If you're using a Git GUI:

Follow the steps to clone Cloudsdale using your GUI.

If you want to pull from the commandline:

First cd $CLOUDSDALE then git clone git@github.com:IOMUSE/Cloudsdale.git

Bundling Cloudsdale

For these instructions, make sure your terminal is in $CLOUDSDALE

Every time an update is pushed, you should run this command to make sure all your gems are properly setup. The command is: bundle install

This should get all the neccessary gems you need to run Cloudsdale. If you get any errors, feel free to ask in the Meta cloud, or check the Known Issues page here on Github.

Setting up the database

The first time you run Cloudsdale, you need to properly setup your local database.

Create the appropriate folders

Assuming you're still in $CLOUDSDALE, run mkdir db/data/mongodb

Setup the database user

While still in $CLOUDSDALE run foreman start. Next open another terminal or terminal tab and run mongo localhost:52331

Now that you're connected, run use cloudsdale_development db.addUser("cloudsdale_development", $PWD)

where $PWD is the password line from the development section of mongoid.yml. When this is done, you can exit mongo.

Next, with foreman still running, use the command bundle exec rake db:migrate to create all the server entities you need to run Cloudsdale.

Starting Cloudsdale

Now that you have your database user make sure that foreman is still running in your other tab/window, open two more tabs/windows and then run rails s in one and redis-server in the other to start up the Cloudsdale web server. You can now direct your browser to local.cloudsdale.org:3000 to interact with the web forms, or run rails c in another tab/window to interact with Cloudsdale from the commandline.