Preparing The Tools - Developing Games With Ruby (2014)

Developing Games With Ruby (2014)

Preparing The Tools

While writing this book, I will be using Mac OS X (10.9), but it should be possible to run all the examples on other operating systems too.

Gosu Wiki has “Getting Started” pages for Mac, Linux and Windows, so I will not be going into much detail here.

Getting Gosu to run on Mac Os X

If you haven’t set up your Mac for development, first install Xcode using App Store. System Ruby should work just fine, but you may want to use Rbenv or RVM to avoid polluting system Ruby. I’ve had trouble installing Gosu with RVM, but your experience may vary.

To install the gem, simply run:

$ gem install gosu

You may need to prefix it with sudo if you are using system Ruby.

To test if gem was installed correctly, you should be able to run this to produce an empty black window:

$ irb

irb(main):001:0> require 'gosu'

=> true

irb(main):002:0> Gosu::Window.new(320, 240, false).show

=> nil

Most developers who use Mac every day will also recommend installing Homebrew package manager, replace Terminal app with iTerm2 and use Oh-My-Zsh to manage ZSH configuration.