Book Image

Instant RubyMine Assimilation

By : David L. Jones
Book Image

Instant RubyMine Assimilation

By: David L. Jones

Overview of this book

Ruby and Ruby on Rails applications can become very complex very quickly, with hundreds of different files to contend with during a typical day of development. With RubyMine, you can become much more productive and let the IDE take care of the menial tasks while you concentrate on the details and structure of your applications. Instant RubyMine Assimilation shows you how to integrate the RubyMine development environment into your everyday development process. With step-by-step instructions and practical examples, you will learn how to customize the environment precisely to suit your needs, debug and test your code, and get the most out of many other features of RubyMine. Starting with the installation of RubyMine on your preferred platform, this guide will walk you through creating your first program. You will be taken through everything from the development and testing process all the way to deploying your website for the world to enjoy. You will learn how to manage your project in RubyMine including integrating version control, testing, and debugging your projects. Furthermore, you will learn how to navigate complex projects, view database tables, and utilize the built-in console and deployment tools of RubyMine, all of which will help you become an expert developer This book will also teach you how to install and use Gems, change Ruby environments, and use code coverage and reports to enhance your testing. By the end of this book, you will be able to confidently deploy your Rails application to a server, all within the inviting environment that is RubyMine.
Table of Contents (7 chapters)

First contact – installing Ruby and RubyMine (Must know)


This recipe will describe the options available for installing RubyMine on the three major platforms—Windows, Mac, and Linux. It will briefly cover the steps for installation of the most recent version.

Getting ready

In order to proceed, you must have already installed a version of the Ruby programming language. The installers for these can be found at http://www.ruby-lang.org/en/downloads/.

It is recommended that you download the latest version of Ruby if you are a beginner, which is v2.0. Follow the instructions on the site mentioned previously, depending on your particular operating system.

RubyMine is an application that is written in Java and requires the Java Runtime Environment to work. We will need to download and install the appropriate version of Java as well. If we don't install Java first, then RubyMine will download and install the appropriate version for you the first time it starts. Java installation programs can be found at http://java.com/en/download/manual.jsp.

How to do it...

We will now install the actual RubyMine software depending on your operating system.

RubyMine can be found at http://jetbrains.com/ruby.

Let's have a look at the steps involved in installing RubyMine on a Mac OS X system:

  1. Point your browser to the previous address and download the free trial of the software. This will be in the form of a standard Mac OS X disk image (DMG), as shown in the following screenshot:

  2. Open the Disk Image (DMG) and drag the RubyMine file from the DMG to your Applications folder. As shown in the following screenshot, you can now open RubyMine from your Application folder by double-clicking on the RubyMine application:

    Figure 1.2

  3. The first window that you will see is the standard Mac OS X security warning about opening an application from the Internet, depending on your security settings. Select the Open button to continue.

  4. We will then be presented with the opening Welcome window in RubyMine. We have successfully installed RubyMine and can proceed to the next lesson.

Now, let us look at the steps involved in installing RubyMine on Windows OS:

  1. Download the RubyMine installer from http://jetbrains.com/ruby.

  2. Click on the RubyMine executable and the first window that you will see is the standard Windows security warning about opening an application, depending on your security settings.

  3. Select the Run button to continue. You will get the following RubyMine setup wizard window:

  4. Follow the standard installation steps and select the defaults for the options presented.

  5. When the installation finishes, you will be given an option to run RubyMine. Do this and you will see a screen that will ask you to import your settings from a prior version and then a screen asking for your license.

  6. If you have a license, enter the two pieces of information into the fields provided and then hit OK.

  7. Otherwise, just select the option Evaluate for free for 30 days and you will have your 30-day trial of the software. You can always enter your license later—after you have been assimilated.

  8. Continue on and agree to the license agreement, and you will then be shown a screen similar to Figure 1.2, the screen showing the message Welcome to RubyMine.

Last but not least, let us look at the installation of RubyMine on a Unix environment.

Most of the X-Windows types of environments in the Unix/Linux world work the same, but we are now going to see the Ubuntu installation:

  1. Point your browser to the same URL http://jetbrains.com/ruby and select the Download Free Trial link. This will begin the download of a .tar.gz file and depending on your environment, your browser might ask you to open it with the Archive Manager option, as shown in the following screenshot:

  2. Select OK and the archive manager will show us a folder of the uncompressed files.

  3. Click on the Extract button on the top toolbar of the archive manager and select your home folder to save the folder into.

  4. Once extracted, we can then navigate to the new RubyMine folder and we will see a file called Install-Linux.tar.txt.

  5. Follow the instructions contained in this file to complete the installation.

    The main item to pay attention to is the second option in the file:

    2. Open a console (ctrl-alt t) and cd into "{installation home}/bin" and type:

    ./rubymine.sh

    to start the application.

    Doing this will begin the application installation process.

  6. A screen showing the options to agree to the license and the option checked for the 30-day trial will be presented with a screen like this:

  7. Select the defaults for now and hit OK to continue.

There's more...

If you run into any errors, some of the solutions are found below. If you have any other problems, you will have to consult the RubyMine website help system.

If you get an error while running the rubymine.sh file in Linux (Ubuntu) like the following:

ERROR: Cannot start RubyMine

No JDK found. Please validate either RUBYMINE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.

In this case, you must install a Java Development Environment first and then re-run the rubymine.sh file as before.

To install Java on Ubuntu, you must enter several commands. There is a good tutorial on installing the Oracle JDK found at http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7.

Please note that the OpenJDK is not recommended for use with the RubyMine software.

Once this is complete, you can continue with the RubyMine installation as before.