Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
RubyMotion iOS Development Essentials

You're reading from  RubyMotion iOS Development Essentials

Product type Book
Published in Jul 2013
Publisher Packt
ISBN-13 9781849695220
Pages 262 pages
Edition 1st Edition
Languages

Table of Contents (19) Chapters

RubyMotion iOS Development Essentials
Credits
About the Authors
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
1. Getting Ready for RubyMotion 2. Instant Gratification – Your First Application 3. Evolution – From Objective-C to RubyMotion 4. Mastering MVC Paradigm 5. User Interface – Cosmetics for Your App 6. Device Capability – Power Unleashed 7. Interface Builder and WebView – More Goodies! 8. Testing – Let's Fail Gracefully 9. Creating a Game 10. Getting Ready for the App Store 11. Extending RubyMotion Index

RubyMotion installation – furnish your environment


Now that we have got a good introduction to RubyMotion, let's set up our development environment; but before that let's run through some of the prerequisites.

Prerequisites for RubyMotion

  • You need a Mac OS: we can't develop iOS applications with RubyMotion on any other operating system; so we definitely need a Mac OS.

  • OSX 10.6 or higher: RubyMotion requires a Mac running OSX 10.6 or higher. OSX 10.7 Lion is highly recommended.

  • Ruby: the Ruby framework comes preinstalled with Mac OS X. If you have multiple versions of Ruby, we recommend that you use Ruby Version Manager (RVM). For more details, visit https://rvm.io/.

  • Xcode: next we need to install Xcode, which includes the iOS SDK, developed by Apple and essential for developing iOS applications. It can be downloaded from the App Store for free. It also includes the iPhone/iPad simulator, which will be used for testing our application.

  • Command Line Tools: after installing the Xcode toolchain, we need to install the command-line tools package, which is necessary for RubyMotion. To confirm that command-line tools is installed with your Xcode, open Xcode in your Applications folder, go to the Preferences window, and click on the Downloads tab. You should see the Command Line Tools package in this list. If it is not yet installed, make sure to click on the Install button.

Tip

If you have an old version of Xcode, run the following command on the terminal:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

This command will set up the default Xcode path.

Installing RubyMotion

RubyMotion installation is really simple and takes no time at all. RubyMotion is a commercial product that you need to purchase from www.rubymotion.com. Once purchased, you will receive your unique license key and installer.

RubyMotion installation is a five-step procedure and is given here:

  1. Once you have received the package, run the RubyMotion installer as follows:

  2. Read and accept the EULA (End User License Agreement).

  3. Enter the license number you have received as shown in the following screenshot:

  4. Time for a short break—it will take a few minutes for RubyMotion to get downloaded and installed on your system. You can relax for some time.

  5. Yippee!! There is no step 5. And that's how quick it is to start working with RubyMotion.

Update RubyMotion

RubyMotion is a fast-moving framework and we need to upgrade it once there is a new release available. Upgrading RubyMotion is again really simple—with one command, you can easily upgrade it to the latest version.

sudo motion update

You need to be connected to the Internet for an upgrade to happen.

Note

If you want to work on an old version, you can downgrade using the following command:

sudo motion update –force-version=1.2

But we recommend using the latest version.

How do we check we've done everything correctly?

Now that we have installed our RubyMotion copy, it's good practice to confirm which version we have installed; to do this, go to the terminal and run the following:

motion –v

This command outputs the RubyMotion version installed on your machine. If you get an error, you need to reinstall.

Pick your own editor – you are not forced to use Xcode

With RubyMotion, you are not forced to use Xcode. As every developer is more comfortable with a specific editor, you are open to choose what you like. However, we recommend the following editors for Ruby development:

  • RubyMine

  • Vim

  • TextMate

  • Sublime

  • Emacs

Tip

RubyMine now provides full support to a RubyMotion project.

How to get help

If you are facing some issues, the preferred way to get a solution is to discuss it at the RubyMotion Google group, (https://groups.google.com/forum/?fromgroups#!forum/rubymotion), where you can interact with fellow developers from the community and get a speedy resolution.

Sometimes you might not get a precise response from the RubyMotion group. Not to worry, RubyMotion support is there to rescue you. If you have a feature request, an issue, or simply want to ask a question, you can log a support ticket—that too from the command line using the following command:

$ motion support

This will open up a new window in your browser. You can fill and submit the form with your query. Your RubyMotion license key, email address, and environment details will be added automatically.

Tip

The RubyMotion community is growing at a very fast pace. In a short span of time, a lot of popular RubyMotion gems have been created by developers.

You have been reading a chapter from
RubyMotion iOS Development Essentials
Published in: Jul 2013 Publisher: Packt ISBN-13: 9781849695220
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}