Showing posts with label Rubymine. Show all posts
Showing posts with label Rubymine. Show all posts

Tuesday, November 29, 2011

New RubyMIne EAP release

I just updated to RM-112.49 release today, November 29, 2011. It seems to be an improvement over the previous release, about 1% less CPU usage and 20 fewer threads.

Why use the EAP release? Well, it has more support for Rails 3.1.

Why use RubyMine over other editors / IDEs? This is a much harder question to answer. Let me tell you I have used just about all of the reasonable alternatives. None are perfect.  Some work faster and are more native applications.  But I like the rvm and git integration.  It also has most of the best features of other alternatives plus a lot of its own.  It is a little slower but with a really fast machine it is hardly noticeable.

Saturday, November 26, 2011

Update on Redo

Well, there have been some upgrades while I took time off to work on iOS programming and my Ruby teaching material.

RVM

$ rvm --version
rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

Ruby

$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

Rails

$ rails --version
Rails 3.1.3

RubyMine

I decided to try RubyMine 4.0 EAP instead of version 3.x.

Use the normal techniques from Hartl's tutorial to setup ruby and rails.  You just had use the appropriate version numbers when setting up Ruby and Rails.

Once everything is installed, just start up RubyMine and use Preferences to setup git and the default Ruby / Rails environment to use.

I setup a new directory for these projects and then created first_app from the tutorial using RubyMine. I did compare to hand generated version and they were the same so I am feeling comfortable with this version of RubyMine.

Thursday, September 15, 2011

Redo Rails 3.0 Tutorial in 3.1 using Rubymine

First Steps

This is the first of a series of blogs about my experiences redoing Michael Hartl's Rails 3.0 Tutorial in 3.1.  He published a 13th chapter that basically says try to move a file at a time from the completed 3.0 sample application until you get it working.  I am going to take a different approach.  I am going back to the beginning of the sample app and create it from scratch using Rails 3.1 and Rubymine. The only thing I will start with is all the gems needed.  Below is the Gemfile:

I did the original tutorial using several editors: Vim, Textmate, BBEdit, and Aquamacs. Each had its features and problems. None of them could be classified as a full featured IDE.  I have done enough large enterprise projects using Java that realize the value of an IDE. Even in my Smalltalk days the VisualWorks editor could be classified as an IDE, and it was a dynamically typed language also. So I decided to try Rubymine.

The first step was getting Rails 3.1 installed. There was my first surprise.  I had upgraded the Mac OS to Lion and upgraded Xcode since the last time I had tried to install a new version of Ruby or Rails.  The install failed and it turned out I needed to install the rest of Xcode so that gcc would be put in /usr/bin as well as /Developer/usr/bin/gcc.

So here is my starting environment:

  • Ruby 1.9.2p290
  • rvm 1.8.3
  • Rails 3.1.0
  • rake 0.9.2
  • All the gems in Gemfile as well.

First step is install Ruby 1.9.2p290, make sure that gem and rake is up-to-date.  Then use rvm to setup a dedicated gem set.

In Rubymine set the Ruby SDK and gems

Ruby SDK and Gems

Then create a new Rails project.

First step in creating Rails project

Note we are skipping Test::Unit files.

Second step in setting up Rails project

Then setup the Gemfile and use Tools menu to Bundle install.

Now to use Rspec.  First one needs to [Reload generators list] to load the rspec:install generator (it is there because of the Gemfile but the install did not update the generators list). Then select spec:install

Screenshot 03

And no arguments

Screenshot 04

My .gitignore file looks like this

.bundle
db/*.sqlite3
log/*.log
tmp/
.sass-cache/
webrat.log
*.swp
*~
.DS_Store
.idea/*

We now have the base to build on and we are ready to make our first git commit.  The Version Control menu includes a menu item for initial setup.  By selecting the git init you can put the entire directory under git version control. Once I used git init version control menu items changed to support git. See Rubymine's online documentation. All that was left was adding the files and doing the initial comment.

The uncommitted files:

The unversioned files

After adding files and switching to folder view:

Files added before commit in folder view

Commit window:

Initial commit window