Configuring RhoMobile Suite v5.0 on a clean OS X Mavericks machine

RhoMobile Suite v5.0

The new main release of Rhodes, RhoElements and RhoConnect had just been released a couple of weeks ago during OSCON. It’s now time to install it and start building some mobile apps!

In this post I’d like to help you installing RMSv5.0 on a new OS X Mavericks machine and install everything that is needed to build iOS and Android applications, the only pre-requisite is to have a valid OS X Mavericks license installed on a Mac or inside a virtual machine… on a Mac :-).

Update OS X to the latest version

The first step is to check that the version of OS X on your machine is up-to-date, a quick stop in the Mac AppStore Updates tab can give you an idea of what is available.

Install XCode

The next step is to install the latest XCode on you OS. In this guide I’m using XCode 5 as version 6 is still in beta, and we like stable releases!

Once you’ve installed XCode, you need to launch it to accept Apple EULA.

Familiarize with the terminal

During the initial RMS setup some of the steps require that you use the Terminal, also known as command prompt or console.
The Terminal is already available on OS X, and you can find it inside the Utility folder in your Applications.

Once you’ve launched the Terminal could be very useful to keep it into the dock, as we will need it for some of the steps to complete RMS setup.

Install Java JDK7

OS X Mavericks comes without any Java environment installed, «the easiest way» to install it, is to open the terminal and type:

java -version

This will pop up a windows asking if you want to install Java, the answer is a resounding YES!

Selecting More Info… will open the Safari browser on the Oracle website, you can select the most up-to-date JDK v7 for OS X to download

and Install

When the install is complete you can test that the java environment is now available:

Install HomeBrew

HomeBrew is an open source package manager, working from the command line, that help setting up open source application on OS X.

Paste that at the terminal prompt, execute it and follow the on-screen instruction accepting all the defaults.
Next step is to check that HomeBrew is setup correctly:

brew doctor

If everything is setup correctly you get the message: Your system is ready to brew:

If you get a different message with some missing or misconfigured software you can follow the on-screen-instruction or you can find further information on the HomeBrew Wiki.

Install RVM and Ruby 1.9.3

OS X Mavericks comes with Ruby v2.0 installed by default, however RMSv5 requires Ruby v1.9.3. Overall working with Ruby can require to switch ruby environment often and to release this pain some utilities has been created.

In this case we’re going to install RVM and use it to install Ruby v1.9.3.
First we need to install some prerequisite using HomeBrew:

In this case Ruby v1.9.3 is the current and default ruby environment. If this is not the case, you can set it up as the default ruby using the command:

rvm alias create default 1.9.3

To get more information on RVM you can check the documentation available on its website.

Install git, node and other little utilities

RMS uses git a lot, to sync projects with RhoHub, and is overall a nice tool. It’s already installed on Mavericks, but is version 1.8.5.2, better to keep an up-to-date version using HomeBrew:

brew install git
git --version

This will install git v2.0.4 (at the moment of writing this).

If asking to the system for the installed git version still report 1.8.5.2:

git --version
git version 1.8.5.2 (Apple Git-48)

Then you need to modify the PATH environment as suggested using the command:

rhomobile$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:
git
git-cvsserver
git-receive-pack
git-shell
git-upload-archive
git-upload-pack
Consider setting your PATH so that /usr/local/bin
occurs before /usr/bin. Here is a one-liner:
echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

So, using the command:

echo export PATH='/usr/local/bin:$PATH' >> ~/.bash_profile

Solve the issue (after closing and restarting the Terminal).

The second application that we need to install is NodeJS, this is needed by RhoConnect Push and to support RhoConnect Source Adapters in JavaScript. Again, we use HomeBrew for this:

brew install node

The Latest application we need to support RhoConnect is Redis, again we can use HomeBrew to install it:

brew install redis

Then we can install at least one command line utility that can be very handy looking for «stuffs» inside source codes: The Silver Searcher:

brew install the_silver_searcher
man ag

As always, using man in the command line will open the documentation for the command, in the case of the silver searcher, the command is ag (like the Silver symbol).

Install Android SDK and NDK

Next step is to install what is needed to build RhoMobile Android Applications. You need to remember that to compile RhoMobile native applications you need to have the target OS tool chain. For Android this means the SDK and the NDK.

Create a RhoMobile.com account

Version 5 of the RhoMobile Suite has a new licensing, that is a yearly subscription available in different levels, starting from a free one, up to an Enterprise grade.

Whatever the level you choose, you need to create an account on the RhoMobile.com website to use the Suite, both from RhoStudio and from the command line tools.

Launching RhoStudio

RhoStudio and the whole RhoMobile Suite is now installed on your Mac, but you still need some steps to finish the configuration and start doing some coding. First of all launch RhoStudio from the Application folder (launch the 64-bit version) and select the second ruby environment for it.

At this moment you will get a request to install a J6SE environment, go ahead and install it (the JDK we installed is for the Android SDK, this is used to run Eclipse)

Finally we’ve RhoStudio running, we need to configure it!

BTW: if the first launch ends with and error in RhoStudio console, simply close it and relaunch RhoStudio again, you end up with a login request, simply use the RhoMobile account you created at the previous step.

RhoStudio Setup

There are some parameters to setup in RhoStudio before being able to build any project. Opening the settings windows using Command-, you can setup:

JDK Path = /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk

Android SDK Path = /Development/android-sdk-macosx

Android NDK Path = /Development/android-ndk-r10

as shown in these images:

Another (easier?) way to configure Rhodes is doing it from the command line:

Build your first RhoMobile application

I’ll cut this short at this moment, you should have everything setup at this moment and you should be able to follow the instructions on RhoMobile website. You can reach out to me if you’ve any question and I plan to add another post with some «post-setup» optimization in the near future.