Skip to content

Development Setup

Nathan Youngman edited this page Oct 20, 2010 · 27 revisions

Some things you’ll need to do in order to get this project up and running:

  • Install bundler: gem install bundler
  • Install redis, version 2.0 or higher. If you have homebrew, do brew install redis -H.
  • Move into your cloned gemcutter directory if you haven’t already: cd path_to_clone
  • Gemcutter is configured to use PostgreSQL (8.4.x), for MySQL see below.
  • Install test dependencies: bundle install vendor/bundler_gems
  • Setup a database.yml cp config/database.yml.example config/database.yml (double check/update)
  • Create the databases: rake db:create:all
  • Run redis-server.
  • Update the db schema: rake db:migrate
  • Run the tests: rake

Make sure you run rake gemcutter:index:update before running the app on your own machine, this primes the filesystem gem index for local use.

MySQL

  • Modify Gemfile to use mysql instead of pg
  • If you’re running Max OS X Snow Leopard, the MySQL gem will fail to install without configuring it as follows:
bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
export ARCHFLAGS="-arch x86_64"
  • Continue setup as above, installing dependencies, setting up database.yml, etc.

Warning: Gem names are case sensitive (eg. BlueCloth vs. bluecloth 2). MySQL has a utf8_bin collation, but it appears that you still need to do BINARY name = ? for searching. It is recommended that you stick to PostgreSQL 8.4.x for development.

Working on the Gem

For testing/developing the gem, cd into the gem directory. Please keep the code for the gem in there, don’t let it leak out into the Rails app.

Getting some test data

A good way to get some test data is to import from a local gem directory. gem env will tell you where rubygems stores your gems. Run rake gemcutter:import:process #{INSTALLATION_DIRECTORY}/cache

If you see “Processing 0 gems…” you’ve probably specified the wrong directory. The proper directory will be full of .gem files.

Pushing gems

In order to push a gem to your local installation use a command like the following:

RUBYGEMS_HOST=http://localhost:3000 gem push hola-0.0.3.gem 

Contributing

Be sure to read through the Contribution Guidelines.

Clone this wiki locally