Skip to content
thinkclay edited this page Mar 13, 2013 · 2 revisions

Installation

The best way to install teacup is with Bundler and rvm. In this example, I will install a "teacup" project so we can run the sample projects.

Disclaimer: There is more than one way to use rvm/Bundler, this is just one. I prefer to have one gemset-per-project, others don't use them at all.

First, tell rvm which version of ruby to use. This is a formality, since we will be using rubymotion to compile, but this version is the version that will run the Rake tasks.

> rvm use 2.0.0
Using /Users/colinta/.rvm/gems/ruby-2.0.0-p0

Next create a gemset for your project. I'll call it "teacup", you call it whatever you want.

> rvm gemset create teacup
'teacup' gemset created (~/.rvm/gems/ruby-2.0.0-p0@teacup).

Later, when you want to work on this project, you will activate this gemset using gemset use:

> rvm gemset use teacup

Now we get to bundler!

> gem install bundler

If you are in the teacup directory, and are going to run the samples, you could now run bundle install to install teacup. If you are in your own project, you should create a file called Gemfile and it should look like this:

source 'https://rubygems.org'

gem 'teacup'

# or optionally, use the git repo instead as your source:
# gem 'teacup', :git => 'https://github.com/rubymotion/teacup.git'

Two more steps, hang in there.

Anytime you add a gem to this file, run

> bundle install

To install them. Bundler can install from rubygems.org, from a git repo, or from a local folder.

Lastly, you just need to update your Rakefile

$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
require 'bundler'                 # <= add these two lines
Bundler.require                   # <=
# ...

The beautiful thing is that you can add gems to this file, compile your program, and it will not trigger the recompilation of your entire project! If you have dependencies, though, you might have to rake clean first.

Clone this wiki locally