Archive for the 'Linux' Category

Ruby Development on Linux, Part 3

July 11, 2009

I’ve posted earlier about my attempts to find the perfect development environment on Linux, an environment that would match the elegance and ease of TextMate on OS X.  I’ve always been a fan of the freedom that you get with Linux and I’ve been willing to sacrifice prettiness as long as the environment is intuitive and easy to use.

So far, my journey has been wrought with failures, but there have been a few bright spots.

By far, my favorite platform is Ubuntu.  They’ve really nailed the desktop usability aspect as it trumped CentOS and Fedora in being able to recognize my video card and use dual monitors.  However, Ubuntu still suffers from some quirks.  With full visual effects enabled, I can only open so many instances of Firefox without strange things like page content not scrolling.  When I hit a certain number of windows open over several desktops, Gnome freaks out and merges them all into a single workspace, disabling full visual effects.

I have tried many text editors and IDEs but all come up short in some way.

I can’t stand vi’s separate edit and navigation modes.

XEmacs is quick and powerful, but there are too many quirks that keep me from loving it.  The speedbar widget exists as a separate window, which makes task switching more of a pain.  Simply finding settings and saving them across sessions is cryptic and difficult.  Installing a language extension requires some elisp programming.  I just want to click!  Copy and paste are broken.  If I copy in emacs, I can’t paste into another app, and vice-versa.  The only way to do it is to use the edit drop-down menu in each app.  Aside from that, the actual act of text editing in emacs is a breeze.  However, I still miss the Textmate macros that generate things like RSpec describe and it blocks.  One redeeming quality of xemacs is that I can have multiple windows open.

Netbeans works, but is a bit slow.  I also hate having to create an nbproject folder to keep project state.  The same goes with Eclipse, Aptana, JetBrains, and all the rest.  IDEs are too cumbersome, especially when most of them force you into a MDI interface.  I really like having many different windows open when editing a project.  Tabs just don’t do it for me.  In fact, that’s one area where Textmate disappoints me.

I had tried to make gedit act like Textmate, but it would crash a lot.

Lately, I’ve had the best results with Komodo Edit.  I’ve been able to customize the keyboard shortcuts so that alt acts just like the command button in Textmate/OS X.  It’s very helpful when I have to switch off our Mac onto the Linux box.  I’ve also set up a “cobalt” theme.  Working in split-screen mode with the whole project window spanned across monitors works well enough for my desire for multiple windows.  I can have the code on one side with the spec on the other.  Komodo also features the quick file open command and can show you where a method is defined.  The drop-down autocomplete is also nice.  There is no integration with rspec, et al, but I’m fine using the terminal.  In fact one annoyance I have with Textmate is that any output to STDOUT in a spec is assumed to be HTML in Textmate’s output screen.  This means I have to use HTMLEntities.new.encode when inspecting an object.  With the terminal, text is text!  Komodo also requires project files to be maintained in the root directory of your project, but I guess I can live with that.  One final complaint: Komodo tends to crash if I have too many separate windows open.  I guess I just can’t have 6 projects open at a time.

Redcar is a very promising project.  It’s designed to act just like Textmate and will support TM bundles.  It’s also written in Ruby!  The only thing that has kept me from using it is that the gtk-ruby libraries that it uses have C extensions that are written specifically for Ruby 1.8.  I’ve spent a good chunk of time porting them to 1.9 compatibility, but it’s such a large task I don’t have time to port it all.  I do have Ruby 1.8 installed in parallel, but trying to get everything to run proves difficult when different components of Redcar try to run /usr/local/bin/ruby (which points to 1.9 on my system).

Over all, Komodo on Ubuntu has made life manageable, but not quite the experience I get with Textmate.  I’m sure once Redcar is 1.9 compatible I’ll be switching.

Linux Editor Update

May 1, 2008

Well, no sooner than I had written the previous article, did I consider NetBeans.  At this point I was willing to try anything, so I downloaded the special Ruby distribution and gave it a whirl.  One of the prereqs was the Java 1.6 runtime, a hefty download.  As NetBeans opened for the first time, I was greeted with a splash screen with a progress bar inching along as various Java libraries were loaded.  This did not bode well!  My bloat-meter was starting to register.  

However, once NetBeans was up and running, I found it to be pretty intuitive and it runs very well.  Response to input is instantaneous and the editor does a good job of not getting in the way.  I really enjoy the SVN integration as well.  It’s very easy to ignore files and perform the usual updates/commits.  The merging tool has some of the slickness of Apple’s FileMerge and many of the features of my favorite diff tool, Beyond Compare.

My only beef so far is that auto-complete is invoked with CTRL+space and I don’t think you can map it to TAB and still be able to use TAB for its original purpose.  The autocomplete also only works by selecting items from a drop-down.  It won’t just guess what you want.  

But overall, NetBeans has been my favorite Linux text editor for Rails.  However, I think I’ll have to stick with gedit or Eclipse for my Perl editing.

Ruby/Rails on Linux (oh yeah, Perl too)

April 26, 2008

So I’ve spent the last four months developing Rails apps, Ruby scripts, and Perl scripts on a Fedora desktop. I cut my teeth with Ruby/Rails on my Mac at home, so I was in on the TextMate and Growl goodness. It’s comical to see that 90% of Rails developers are on the Mac, and one would assume that it’s because if one must use a trendy framework, they must also choose a trendy development platform. The truth is, I just haven’t found sufficient analogues to Mac tools in the Linux environment.

The first editor I experienced (and the one I keep coming back to) is Eclipse/Aptana/RadRails. It is a beast of an IDE, taking several seconds to load on a capable dual core AMD 64. Here’s some other issues I run into on a daily basis with the 1.0 release (which, to me, would imply feature complete and stable):

  • RadRails “forgets” about syntax highlighting and makes everything purple.  Sometimes, typing space at the end of a line and saving will fix it, but it’s a crap shoot.
  • Eclipse will occasionally slow down to a crawl for about a minute.  The GNOME task monitor says the CPU is idle, but Eclipse would make you think it was sharing CPU time with a nuclear explosion simulator.
  • The “go to resource” dialog doesn’t quite load results for every file that matches your criteria.  It also takes an extra arrow key press to get through the list.
  • If left open for too long, the inevitable, “There was an error, would you like to exit the workbench?” dialog appears.  You can say “no” but then you’re just living on borrowed time.  Eventually, it will all come crashing down.
  • Of course, there are not nearly as many cool shortcuts and scriptability that TextMate offers.
After getting frustrated with RadRails, I turned to gedit, GNOME’s text editor.  Apparently, there are several plugins you can get to make it act almost like TextMate.  It’s also very lean and responsive.  First of all, the gedit website was down when I tried to get the plugins.  Then, it became a confusing ordeal to get the plugins installed correctly.  Gedit also liked to keep backups of each file sitting right next to the real files.  This made SVN a bit messy when I would just run an svn commit on everything.  Furthermore, the plugins, like the quick file open, didn’t even work 100%.  After some gedit crashes, I decided to ditch it and look further.
After trying the two major open source editors, I looked into ActiveState’s Komodo IDE.  It’s a paid app running at $300.  This IDE was the most consistent, stable, and feature-rich app out there.  However, it had major performance issues.  Simply scrolling through the list of files in a project slowed the app to a crawl.  I installed the version compiled with gcc 5, which offered a slight speed improvement, but still wasn’t snappy enough to facilitate rapid development.  It wasn’t worth $300.
So now I’m back to Eclipse.  Yes, I know there’s always vi and emacs, but I’m feeling too lazy right now to learn all the keystrokes required for things as simple as highlighting text and switching files.  I’d rather just use the mouse that God gave me.
As far as a Linux analogue of Growl, there is Mumbles.  At this point, it seems like too much of a hassle to find all of the plugins to make Mumbles work with even simple services/apps.  I love how many apps now (like Firefox 3) have Growl support built right In.  
Which brings me to my point.  The Mac is sort of like a “GUI on Rails.”  Its API sets stricter conventions on how an app should work, but with those limits comes the benefits of simply getting things done and the ability to focus on the grander issues – like interoperability and bleeding edge features.  In the Linux world there is an amazing freedom of choice, but with it comes chaos and a lot more work that goes toward just getting things to talk to one another.  While the freedom is nice, sometimes it’s nicer to work within stricter guidelines and get something done quickly.

    Happiness

    April 21, 2008

    A book I still have to read is [ed. I think it was called] The Science of Happiness whose author was interviewed recently on NPR.  The interviewers discussed the emerging branch of psychology that is studying happiness.  It got me thinking about how perceived happiness is a major market factor and how people now days are more willing to pony up extra cash and make an effort to buy your product or service if it causes them some happiness beyond the satisfaction of having a need met.  

    There are so many examples of this:

    Apple is the most obvious candidate.  Sure, you can buy and build a computer using the same parts Apple does for half the cost.  You can install Linux for free or pay for Windows and get your work done.  Why are people paying more for Macs?  The Mac OS and Apple’s software suites offer a more user-friendly and, ultimately, satisfying experience.  Apple’s users (like me) are happier.  

    37 Signals recently posted about Zingerman’s deli in Ann Arbor and the philosophies they follow that make them a great company.  Yes, you pay $20 for a reuben and a root beer, but the experience of going to the deli outshines many other casual eating experiences.  Customers are showered with free samples of exotic foods and the staff are very personable.  The selection of products is also far beyond what you’d find in many other places.

    This also brings to mind Ruby on Rails.  There are plenty of other MVC frameworks out there that do the same exact thing as Rails.  But there are so many positive externalities that Rails offers that put it above the rest: the community, the Ruby language itself, and the way agile development is baked into the framework and its related plugins.  It really makes for a pleasant development experience.

    The bottom line is that Americans are becoming more willing to pay for products that make them feel better.  This has positive repercussions where a product can benefit the natural environment or society as a whole.  The challenge is to build a brand that offers that extra bit of happiness and (ideally) really does change the world for the better.

    Back to an Old Friend

    January 14, 2008

    Last year I set up my old Athlon 850 as a MythTV (both front and back-end) box. With a PVR-150 and a PVR-250 installed, it was a passable DVR running Mythdora. During our transition to Michigan, it fell out of use. One day I tried to upgrade to MythTV .20 but the Mythdora installation that supported it did not allow me to use the older NVidia drivers and so it would freeze up when XOrg launched. When DataDirect started charging for channel listings. I gave up on the project completely. I put my PC into permanent retirement.

    But then, like the Army coming back to ask John Rambo for help, I coaxed my old PC to help me one more time. Its mission: to run IEs4Linux to aid in some part-time freelancing. I tried to install MythTV .19 and have my MythTV along with IEs4Linux, but the LVM volume kept corrupting for some reason. I then installed Fedora Core 4 and now everything is running beautifully.

    While I had signed up for some shared hosting for my dkast.net domain, the service has proved to be unreliable, so I’ve just decided to host my own sites. It’ll be a better learning experience, too, as I’ll get to work with git, capistrano, and perhaps mongrel/nginx.

    Once you get Linux working, it really is a pleasure to work with.

    Next step: find a way to get my Airport Express to act as an ethernet-to-wireless bridge and WDS repeater simultaneously.