Wednesday, January 16, 2013

How-To: Check out a Ruby project in IntelliJ IDEA

The procedure of checking out code is relatively simple, but there are a few key steps that are essential to get started when dealing with a Ruby project and possibly other language types when working in IntelliJ IDEA. This project assumes that you have already installed the Ruby on Rails plugin for IntelliJ IDEA.


1.  The simplest and most necessary step is to have code to checkout, but after that it needs to be checked out. For this example I am using Git as my source control

2.   Fill out your connection info and target directories.

3.  Create a project from the source just checked out. This may take a while depending on the size of your codebase.

4.  Create project from external sources.

5.  Chose a project name

6.  So far everything seems to work, it's detecting the types for the files in project.

7.  However it doesn't detect any frameworks, which is troubling since it should be Rails.

8.  After the project is created only some of the files in the project are visible.

9.  The next step is to create a new module.

10.  Choose a Ruby Module, give your module a name most likely the same as the project name. By default IDEA will add a subdirectory to your current project, but that folder should be deleted.

Module Name: <module_name>
Content Root: /path/to/IdeaProjects/<project_name>/<module_name>/
Module File: /path/to/IdeaProjects/<project_name>/<module_name>/

This should be changed instead to:

Module Name: <module_name>
Content Root: /path/to/IdeaProjects/<project_name>/
Module File: /path/to/IdeaProjects/<project_name>/

11.  The Ruby SDK should be already selected, if this is not true you may not have installed the Ruby/Ruby on Rails Plugin.

12.  The Ruby On Rails check box should be selected and the "Use existing Rails application" should be selected. Everything else is going to depend on your current setup, so don't just breeze through this screen.

13.  Success, now you can see all the files in your project and you are free to work on your code.

Software Used
IntelliJ IDEA 12
Ruby/Ruby On Rails Plugin

No comments: