Development/Setup

Windows
It looks like it's nigh-impossible to get a decent Ruby/Rails development environment working on Windows. If you are using Windows, we recommend you check out our Hosted hack environment.

Linux and OSX
First, you need to install Ruby and the Rails framework. For reasons that make sense only to the Ruby community, the right way to do this is almost certainly not through your OS's package system. Instead, install using this guide -- it says it's for Mac OSX, but the same steps work fine for Linux, and are the recommended way to proceed.

Note: though the guide talks about Ruby 1.9.3 we're going to install a specific patch level, which is 1.9.3-p194 -- if you're following the guide, replace "1.9.3" with "1.9.3-p194" throughout.

Here's a quick list of steps, which should work in most cases:

Install rvm
curl -L https://get.rvm.io | bash -s stable

Then either restart your terminal/logout and login again, or run  (substituting "yourname" for your actual username) to get rvm in your $PATH and all that.

Install ruby, rails, and sqlite3
Then, from the command line:

rvm install 1.9.3-p194 rvm use 1.9.3-p194 rvm --default 1.9.3-p194 gem install sqlite3 gem install rails rails -v

If any of this doesn't work, read the guide which gives more detail, or ask on the Mailing list or IRC for help.

Fetch the Growstuff source code
First go to http://github.com/Growstuff/growstuff, click "Fork", and make your own copy of our code repository.

Then (replacing your name as appropriate):

git clone https://github.com/YOURNAME/growstuff.git

If you have set up an ssh key on github (and you should!) you can use this instead, and avoid having to type in your password so much:

git clone git@github.com:YOURNAME/growstuff.git

You should also set up a "remote" pointing to the central Growstuff repository:

cd growstuff git remote add upstream https://github.com/Growstuff/growstuff.git

Later on, you'll probably want to set up other remotes pointing to the repositories of people you're pairing with. You do that in the same way: for instance, if you were pairing with User:Cesy, you'd run the command

git remote add cesy https://github.com/cesy/growstuff.git

For more information (for instance, if you are using git for the first time) see Git.

Set up your rails environment
Then go into your growstuff folder (cd growstuff) and do the following commands:

rvm use 1.9.3-p194 rvm gemset create growstuffdev rvm gemset use growstuffdev rvm --default use ruby-1.9.3-p194@growstuffdev gem install bundler bundle install --without production staging

If at this point `bundle install` tells you "Can't find blah in any of the sources" (for blah = some package we need), run `bundle update` and then `bundle install` again and that should fix it.

Now you need to set up your databases:

rake db:setup rake db:test:prepare

Run the test suite just to make sure everything's working:

rake

(You should see a row of green dots and no red "F"s. If not, your pair should help you resolve whatever the problem is!)

And finally, run the web server on your local machine so you can see Growstuff in action:

unicorn

Point your browser at http://localhost:8080/ to visit your local dev site.