REST, Ruby On Rails, CouchDB and ME – Part 2 – Aptana IDE For Ruby   3 comments

Part 0 – Introduction to Ruby, RadRails and CouchDB

Part 1 – REST, Ruby On Rails, CouchDB and ME – Part 1 – Ruby

Part 2 – This Post

Part 3 CouchDB Up and Running on Windows

Part 4 – CouchDB, Curl and RUBY

Part 5 – Getting The Data Ready for CouchDB

Part 6 – Getting The Data Into And Out Of CouchDB

MaizeGod

Although not found too often on Windows programming system, the open source programmer’s editor Eclipse is one of the most popular in the world.  The Aptana Corporation (now part of Appcelerator) has developed a Ruby and a Ruby on Rails plug in for this popular browser.  The Aptana plug-in are fully open sourced.  Ruby for Rails version 2.0 is currently supported.  In this post we will not discuss The Ruby On Rails plug-in (that’s for a later post), herein we will look at installing Aptana community editor and getting simple Ruby projects up and running.  Start by downloading Aptana Studio 2.0 from the Aptana site. Install New Features We will add RadRails to Aptana Studio after we install the base Aptana system.  Although Aptana will allow you to down load just the RadRails Editor, if you do this you will not get the full development environment this way.  Trust me.   Be sure you select the Windows installer and proceed to install the Aptana Editor just as you would any other Windows product.  If you are on Vista (and perhaps Windows 7 – who knows) you will want to modify the shortcut for Aptana as outlined here.

Now that you have the base product installed, start the editor, select help and select “Install Aptana Features”.  This gets you to a selection screen where you can select (Under Web Application Platforms)  Aptana RadRails (this is the plug in for RadRails 2.0) and (Under JavaScript Libraries) JQUERY Support (trust me).  Click on Install and follow the prompts.  When you get done we will be ready to rock.  Assuming you have only ONE version of RUBY installed on your machine and that version is on the Path statement the Ruby and RADRails system can figure our how to install itself.  Otherwise you will need to do some manipulations of your Preferences for Ruby and Rails.  The preference screen can be found under the View menu item.

Ruby At LastGems

Aptana provides “Perspectives” for developing Ruby and RadRails Projects.  For each perspective there are multiple “Views” for working with each project type.  Only one perspective can be open at a time but multiple views can (and will) be in use within each perspective.  For example with the Ruby Perspective, we can select the GEM view.  This will give us a nice GUI with which to add, remove and update the GEMs associated with the current version of Ruby we have installed. Nice.Perspective

Let’s start with Ruby (not Ruby on Rails).  To start coding:  Select ‘”View”, select “Open Perspective” and Select “Ruby”.  Select “File”, Select “New”, Select “Ruby Project”.  Give your Project A Name: Let’s use “ClassTutorial”.  Right Click “ClassTutorial” in the tree view of the Ruby Perspective and select “New” and “Ruby File”.  Give this first file the name: “ClasTutorialMain.rb”.  A file editor view will open for entering text into this file.  Enter the following text into the file editor:

class Person   attr_accessor :fname, :lname   def initialize(fname, lname)          @fname = fname          @lname = lname   end   def to_s     @lname + ", " + @fname   end   end puts 'Create New Person' matz = Person.new("Yukihiro", "Matsumoto") puts matz puts 'exit' exit 

Now right click on the view editor.  RIght click on extreme right of line #17 and select “toggle breakpoint”.  Select “Run” from the main menu and “Debug As” and “Ruby Application”.  Now a couple of other ‘views’ will open (Console & Debug).  Your screen should look something like this. Untitled Note that your step debugger controls are in the top right of the Debug Window.  Your watch statements are on the right.  Console output will be displayed in the Console window on the bottom.  You can, of course, positions these windows as you see fit.  While not heaven it is ‘nice’.  Either step through the code or press the RED X to terminate the current run.  To run without the step debugger select Run/Debug As/Ruby Application.

In the next post we will look at some of this code (and more) as we get our feet wet with Ruby and this IDE.

MIX11_BB_SeeYouAt_1 tumblr_lha4s0MgCk1qzt4vjo1_500

Posted 2011/03/15 by Cloud2013 in Aptana, Ruby

Tagged with , , ,

3 responses to “REST, Ruby On Rails, CouchDB and ME – Part 2 – Aptana IDE For Ruby

Subscribe to comments with RSS.

  1. Pingback: ROR Tutorial Ruby on Rails Tutorial Video Ruby on Rails Youtube Videos

  2. Hey very cool web site!! Guy .. Beautiful .. Amazing .

    . I will bookmark your blog and take the feeds additionally?
    I am happy to seek out numerous helpful information right here within
    the put up, we’d like develop more techniques on this regard, thank you for sharing. . . . . .

  3. I suggest Codelobster for Ruby development: http://www.codelobster.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 122 other followers

%d bloggers like this: