OpenSUSE Linux Rants

OpenSUSE Linux Tips, tricks, how-tos, opinions, and news

My Resume  -  My LinkedIn Profile

February 4, 2009

Linux does Ruby on Rails – but what’s the best way?

by @ 9:29 am. Filed under sweet tools

So the boss wants me to learn Ruby on Rails. As a sidenote, right now I’m running OpenSUSE 11.0.

I’d like to use a great IDE so that I can get going quickly. So I have to learn the IDE and the language.

Which IDE to use? Well, I thought since Eclipse is an IDE platform, that I could do PHP and Ruby on it.

I spent the next few days learning how to install Eclipse so that it would work with Ruby on Rails.

Here’s where I stand:

First, install libmysqlclient-devel, because you’ll need to compile the mysql gem for Ruby. Then, install ruby (1.8.6 patchlevel 114 worked best for me), and make sure gcc is installed so you can compile gems when necessary.

When you’re done with this step, check to see what version of ruby you have, and make sure it’s 1.8.6:

$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114)

Next, install eclipse. I found version 3.4 from the OpenSUSE BuildService. Version 3.3 is available for OpenSUSE 10.3.

While that is installing, install rubygems 1.3.1. Again, this version for OpenSUSE 11.0 was only available on the BuildService.

Then, you’ll need to update your gem repository, and then install a handful of gems:

$ gem sources -u
$ gem install rails
$ rails -v
Rails 2.2.2
$gem install mysql cgi_multipart_eof_fix ruby-prof linecache ruby-debug-ide ruby-debug-base mongrel gem_plugin
$ gem update // gets the latest versions of installed gems

When eclipse is done installing, follow the instructions in the “Plugging Aptana into an existing Eclipse configuration” article.

It will prompt you for lots of updates, just go ahead and do them all. Once in awhile, I’ve had it crash, so I just start the article over from the beginning.

Finally, run eclipse, go to the MyAptana view, click on the Plugins icon. You’ll see a list of available plugins. One is PHP, and one is Aptana Radrails. Click on “Get it”. You’ll go through a similar installation process to install that plugin.

Again, if there are any updates, go ahead and do them.

Now, that is how far I’ve gotten, and I’ve even been able to do a tutorial or two with that setup. For all the ruby experts out there who are running it on Linux, what IDE do you use? If you use Eclipse w/RadRails, do you have any further suggestions? If you don’t use Eclipse, why? And if you don’t use Eclipse, what tutorials exist that teach one how to use your preferred IDE with Ruby on Rails?

12 Responses to “Linux does Ruby on Rails – but what’s the best way?”

  1. Stuart Jansen Says:

    Back when I cared about Rails, it seemed the the majority of the community didn’t worry about IDEs. Most were using TextMate on MacOS. Some used emacs. At least one of the core Rails developers loves Vim. http://weblog.jamisbuck.org/2008/11/17/vim-follow-up

    An IDE embodies the exact opposite of the Rails philosophy. IDEs are designed for managing big software projects with lots of boilerplate code. Rails is about convention over configuration, small, simple solutions, that sort of thing.

  2. Hans Says:

    If you need to learn rails in short order, or if you intend to learn rails thoroughly to maximize your power, instead of just enough to squeak by and utterly fail to understand what’s going on, you need to be cognizant of the structure of a rails project and the way it all works together.

    To me, that means steer clear of all IDEs at least until you learn it and can assess what a good IDE for rails would be. I have used Eclipse for Java and C/C++ code, and it does a decent job there, but I have serious doubts that it would make a good IDE for rails. But then I don’t use an IDE for rails (just vim) so take that with a grain of salt.

  3. Aaron Says:

    IDEs are overrated. Don’t get me wrong, they have their place in software development. Most GUI apps are written using them, and they have many features that make software development less painful. However, I think you’re overdoing it here a bit. Ruby has a read/eval/print/loop that will do everything you need to learn the language. Think of BASH or Python. You jump into the interpreter to run some code, seeing how it will execute, then when you’re satisfied, you commit the code to the program. Eventually, you’ll run the program through the interpreter, seeing how it behaves. All of this is done without an IDE. You’re debugging, writing unit tests and overall improving your program with a simple text editor and a shell.

    Now, imagine doing this with an IDE. You need to first create a project that your code will be part of. You have project files, documentation files, source code files, and just about everything else that comes with the overhead of an IDE. Sure, you have auto-completion of functions, classes, variables and so forth, but you’re managing so much more than your single piece of source code that you’re programming.

    For your situation, you’re learning more than what is needed by your boss. It’s almost as if you want to lean how to ride a bike, so you first turn to learning about how roads are built, before you take your bike out on the road. Eclipse won’t help you learn Ruby anymore than learning about roads will help you ride your bike. Stick with the Ruby docs, a basic text editor like Vim or Emacs, and the Ruby interpreter. You’ll get a lot further faster. You can certainly do Ruby on Rails just fine without an IDE.

    Just a thought.

  4. Scott Robertson Says:

    I’m using Vim with the Ruby on Rails plugin from vim.org. Works great for me. The built-in help file is how I learned to use it.

  5. Christopher M. Hobbs Says:

    Personally, I don’t use an IDE with Ruby or RoR. I use Ruby heavily at work and I use Rails pretty heavily in my free time. I use VIM with the bufferlist.vim script and that’s honestly about it.

    I test things in irb before doing anything and keep my “Pickaxe” book handy. I’ve found IDE’s to be a little too bloated for my liking.

  6. Scott Morris Says:

    Alrighty. The community has spoken. Learn to manage RoR projects from the commandline, and develop them in a text editor. Gets one familiar with RoR faster, more hands-on. Thanks for everyone’s input. That’s more or less the direction I was leaning. Thanks a ton, I appreciate the comments. Thanks everyone for stopping by.

  7. Louie Says:

    Well Im not a RoR guy but I do a lot of coding and a half dozen languages and I use Visual Studio on MS and Eclipse on Linux. I don’t care what these guys say (not to be take personally). If you ask which GUI is best for making Web sites, they will come back with the same tools mentioned above. I use Dreamweaver for such a task and my product(s) and compensation are nothing to snicker at. I don’t disagree with the comments above, I prefer to use the right tool for the right job (for me).

    Let us know how you are doing..

  8. Scott Morris Says:

    Louie,
    Love the insight and different perspective. I love diversity in discussion. It gives everyone who’s willing to listen and understand the ability to grow and expand. At very least it gives them another way to view the Universe. Thanks for stopping by and taking the time to share your thoughts.

  9. Scott Morris Says:

    Well, everyone, I purchased the book “Beginning Ruby” from Amazon brand new (and got free shipping). It has about 650 pages. I started reading it at the beginning of the work-day on Monday, reading it only during work hours. It took me 2-1/2 days to get through it. The book itself doesn’t use an IDE per-se (which is good, as we had discussed). It goes through and teaches ruby using the command-line and a text editor. It has a small chapter on Ruby on Rails, but nothing in-depth. I have also just recently pre-ordered “Agile Web Development with Rails, Third Edition”, which came with a PDF of the current revision of the book (which PDF I have just sent to Office Max for printing). As they make further revisions to the book, new PDFs of it will be created, to which I will have access. When the book is released, I will be sent a copy hot off the press. I’m hoping that this covers all the bases (all your base are belong to us). I also have a senior-level RoR developer coming in next week to help me hit the ground sprinting on this. Thanks for all the suggestions. I’m confident that I’ll be up and running on RoR in the next week or two. Maybe I’m delusional, or maybe I’m just really optimistic, or maybe I’m just really driven to keep my job, or maybe I’m a masochist, or maybe I’m just an animal. Jason, Steve, what do you think?

  10. trent Says:

    If you still really want an IDE you should look at netbeans … it comes out of the box with Rails support

  11. Scott Morris Says:

    We seem to be standardizing on netbeans. So far, I’m digging it. Code completion, context-sensitive help, and a bunch of other neat junk. Pretty slick, I think. Thanks for all the feedback, everyone.

  12. Adam Lowe Says:

    I happen to live close to Hashrocket (www.hashrocket.com) and have been learning as much as I can from them. VIM is the editor of choice there, no coincidence that Tim Pope is one of their developers. However after spending a little bit of time to understand VIM I’m finding myself more and more sold on it and less and less attracted to more GUI driven/Mouse dependent IDE’s. Tim’s rails.vim and cucumber.vim plugins make VIM an extremely feature rich editor.

OpenSUSE Linux Rants
Official OpenSUSE Linux Site

internal links:

categories:

SUSE Resources

search blog:

archives:

September 2019
S M T W T F S
« Feb    
1234567
891011121314
15161718192021
22232425262728
2930  

62 queries. 61.751 seconds