Creating Plain .rb Files with Aptana RadRails - ruby-on-rails

I have just bought a MacBook for some ruby development and like the look of Aptana Studio as a really nice IDE.
The question I have, however, is that I want to know (before getting too deep into it, and potentially wasting time) is can I create plain old .rb files without the rails framework attached? Also, can I execute the ruby file straight from the IDE, or will I have to use Terminal?
As I said, I am only just learning Ruby and I am working through some books I have bought, and while I do wish to get into rails soon, I feel its important to learn the language properly, before asking rails to do a lot of stuff for me.
Any other thoughts on best practices and other potential IDE's would also be appreciated.

For just fooling around with Ruby I suggested an editor, the command line, and IRB. You will have more fun and learn more, quicker.
After that, get into IDEs and Rails and all the complexity that comes with them.

I'd recommend Netbeans (Ruby Edition obviously) or Jetbrain's RubyMine over Aptana. I've had issues with Aptana and Ruby when I tried it. Rubymine is still in public preview release status, but it will be a paid product when it's released in a month or so. It's developed by the same people who made IntelliJ IDEA. Netbeans actually works very well with ruby and rails and it's free. Both allow you to execute ruby from within the IDE and have rails support.
I've also found irb very useful, Netbeans allows you to run irb from within the IDE as well. Having code completion and inline documentation helpful when starting out.

Yes, you can create plain old ".rb" files inside RadRails or Aptana Studio, and they don't have to be inside a Rails project or "attached to the rails framework". You can also run or debug a ruby script inside the IDE by right-clicking the file or inside the editor and choosing one of the Run As > Ruby Application or Debug as > Ruby Application entries. With Studio 3 you can even run them from an embedded Terminal view. RadRails 2.x had a Rails Shell where you could run or debug files from a command-line interface as well.
As the developer on RadRails, I'm a bit biased - but I would agree that users should be pretty familiar with using the command line whether they decide to use an IDE for daily programming or not. And of course, having an interactive REPL like irb to play with is another useful tool in getting started. Heck, you can even just use the online one first before installing ruby: http://tryruby.org/

Related

Aptana studio 3 or any IDE or Text Based Editor with ruby on rails assist-code definition

I am used to using an IDE like Eclipse or Netbeans when coding in Java and having a small code assist appear to give me a small description on each of the methods available. Now code assist does work in Aptana Studio 3 for Ruby on rails, but it does not give you a small description of what the methods do, they just give you a list of the methods only. Is there any IDE or Text based editor that can give me code definition while coding or is there a way to configure Aptana Studio to do so?
As I am new to ruby, I do not want to invest and buy an IDE or Text Based Editor as of yet (though feel free to tell me if the payed ones are the ONLY ones to do what I am asking). I am running Windows 7. But if my only option is to run a VM with Linux so as to get what I am asking than please suggest the name of the IDE or Text-based editor.
Thank you.
RadRails must have a code definition according to it's description but i personally prefer not expensive most featured RubyMine
it uses RDoc so you have to be sure you have generated help during gems installation (see docs)...
(another way to browse local gem's docs is RubyGems Documentation - just run $ gem server from console but this is out of the answer to your question)

IDE with refactoring support for Ruby on Rails

I am a java developer and use the Eclipse IDE for developing java code. I use the built-in refactoring features a lot, since good refactoring support from the IDE helps to speed up and leads to higher code quality. I would not like to miss it and use a simple text editor instead. Now I am looking for an IDE for Ruby on Rails with good refactoring capabilities.
Basic refactorings
Wanted basic refactoring methods include:
Extract method
Extract variable
Rename (class, method, variable etc.)
and so on.
Aptana Studio 3, RadRails 2, RubyMine 3 and Netbeans 7
So far I've tried Aptana Studio 3 and was quite disappointed regarding its refactoring capabilities. Aptana RadRails 2 seemed much better for refactoring ruby code, but it lacks other nice features that the newer Aptana Studio 3 offers. Since Aptana Studio 3 seems to be RadRails' successor I would expect that it has at least the same refactorings as the older RadRails 2, but it does not. Using an old unmaintained IDE does not seem a good option. Receiving updates for the IDE should still be possible.
I've read that Jetbrains RubyMine 3 has decent ruby refactoring capabilities, but it costs money. I am rather looking for a free one. Netbeans 7 seems not to support Ruby on Rails anymore.
Are there good IDEs with refactoring support?
That confuses me, it seems like modern IDEs drop (refactoring) support for Ruby on Rails.
What are nowadays (Jan 2012) the most powerful IDEs for refactoring Ruby on Rails code?
Update: Netbeans 7
As suggested by Jörg W Mittag I've tried Netbeans 7 with the ruby plugin provided by the community. I have to say that this combination is much better than Aptana RadRails 2 or Aptana Studio 3 for developing Ruby on Rails apps. The integration of css and html for views is well done and the integration of rails tests into the JUnit Netbeans view comes in handy.
However, the refactoring support seems to be too basic. It supports rename, move, copy and safely delete of methods. It does not support to select lines of code and extract a method out of it nor the similar behaviour for extracting variables.
Update: RubyMine 3
dynex suggested to use RubyMine. I've just played around with it and think its suitability as an Ruby on Rails IDE is at least as good as Netbeans'. The refactor capabilities are by far the best I've seen in a Ruby on Rails IDE so far.
From what I've discovered it features renaming, moving, copying, safe deletion, method extractation, variable introduction, constant introduction, field introduction, parameter introduction, inlining, pulling members up, pushing members doen, module extraction and superclass extraction.
My conclusion is that from the set of IDEs I tested RubyMine was the only one with decent refactoring capabilities. RubyMine costs money, but it seems worth it. The free ones cannot compete regarding refactorings.
Thanks for all answers and comments.
RubyMine was my choice and I use refactoring once in a while. When using 'rename' it's never complete, but better than global-search-replace. Extraction etc works well.
Overall it's a great tool, albeit a memory hog, but I use it all the time now, especially for debugging.
I know, it costs money, but I wanted to put in a good word for them anyway...
Netbeans 7 seems not to support Ruby on Rails anymore
That's not true. Quite the opposite actually. Yes, Oracle dropped support for the Ruby on Rails plugin and gave maintenance over to the Ruby community. But the plugin is still available from the same place it was before, the community is still using the same infrastructure to develop, maintain and distribute the plugin as before. And since most of the people who originally wrote the plugin work for Google now, they can now again work on the code, now that it is no longer owned by the company that is suing their employer.
Thanks for this question firstly, coming from java platform I was not comfortable with the text editors or IDEs available for RoR. I just started using RubyMine for 2 days now and yes it has a reasonable support for refactoring compared to text mate editor. Apart from the other features mentioned here I like code formatting, column selection mode (especially for .haml files), I use Ctrl+Tab to browse between the tabs (as in Netbeans) and of course find usages. I am not yet comfortable with the git integration part yet, need to explore that. If I find anything amazing will update my post.

Does anyone have experience with Ruby in Steel?

Coming primarily from a .NET background, I am quite attached (for better or worse) to Visual Studio.
I'm going to school for software engineering now, though, and my first class is in XP (Extreme Programming) using Ruby on Rails. Mostly I've heard that when you're developing in Ruby, you tend to skip the whole IDE altogether; and I'm totally open to that possibility. There are IDEs out there, though, and so it seems like there must be at least some folks who still find that using one is worthwhile.
Since I am so familiar with VS, I was just wondering if anybody out there has used Ruby In Steel. From the website, it certainly looks nice. I have literally no idea how useful or appropriate it is for general RoR development, though, which is why I thought I'd throw this question out there.
Have you used Ruby In Steel? What are your impressions of it? How does it stack up against other well-known IDEs such as Netbeans? And is it even worthwhile to use an IDE for RoR development, or is a good text editor preferable?
Short answer
Skip the IDE and use Vim (or your favorite, simple, text editor)
Long answer
I'm a C# developer and have used Visual Studio as an IDE since I started programming. I love Visual Studio and always laughed at those people who didn't use an IDE. I just didn't get it. So when I started learning Ruby on Rails, the first thing I did was look for the best IDE available. I tried NetBeans, RubyMine, Aptana, and every text editor I could find (not Ruby in Steel, however, b/c I didn't want to pay for it).
I settled on NetBeans finally and thought it was pretty good. But it takes 30-60 seconds to load. And you soon find out that intellisense with ruby doesn't really work (and even if it did, the rails api's don't really make sense with intellisense anyway). What happened was that I found myself using Notepad++ to make quick edits to my files.
But then slowly I started using Notepad++ more often and would need to have my server running, so I opened up the console to run the server (instead of my ide). Then I needed a controller generated, but it was faster to look up the command line syntax to generate the controller than it was to load my IDE. That's when I started to realize that I didn't really need, or even want, and IDE for rails development, I was perfectly happy with Notepad++. Those no-IDE guys weren't so crazy after all.
So I started looked at all of the text editors I could find and ran across Vim (you know, that crappy old text editor that those grumpy old programmers used to use before I was born). Vim, with some rails plugins, is all I use now for rails development. It was hard to convince my Visual Studio loving self that a console based text editor would actually make me more productive than an full IDE, but once I gave it a chance, I was really impressed.
Now, learning Vim and Rails and Ruby at the same time is a large undertaking, but I would at least recommend you learn the rails command line and use your favorite text editor, instead of a fat, slow, $200 IDE.
I looked at the original release - it was nicely done but the trial period expired and it hadn't become essential to my development existence. To date, no IDE has, although I do keep an up-to-date install of NetBeans for the occasional foray into Rails framework debugging (that's usually bugs in my understanding rather than bugs in Rails, btw).
While the IDEs (and I note that Ruby In Steel 2.0 was just announced in early Nov 2010) are all smart, I have tended to find that applying TDD mostly removes the need for IDE-based step-through style debugging.
Assuming they continue the trial program as before, you should be able to spend 60 days with RIS 2.0 before you have to commit any money. That ought to be enough to establish whether or not it can be worth buying.
I was really interested in Ruby in Steel but I didn't find the trial very useful. This was some time ago and it has more features now. Before you plonk $200 for this, I'd definitely give Aptana RadRails a try as a free IDE, or look at e-TextEditor which is what I use now. It has really good bundles for rails development and is also a great general purpose editor; although it does not have an integrated debugger I've found that I am just as effective without it using the rails console.

Ruby IDEs: any worth looking at?

I currently use TextMate for all my Rails development, and I like it very much, but I wonder if I'm missing anything by not using an IDE. Has anyone switched from using TextMate or another powerful text editor to a Ruby IDE? Am I missing anything?
JetBrains, the people who created the legendary IDEA IDE for Java, have RubyMine in beta. DHH has mentioned it, so it must be good!
TextMate is king for Development on Mac, it's not too bloated and has so many good bundles made by the developers that use those particular languages. Can't be beat in my opinion.
I think IntelliJ/RubyMine is pretty good because I've been coding Java for a while. There's some feature holes for Rails development, but I expect that Jetbrains will quickly fix those in coming versions.
I just got turned onto Textmate because my laptop is a Powerbook 12" G4. Running IntelliJ is pretty snappy, but it makes the fans run constantly with a volume approaching "airplane engine". Working with Textmate keeps my laptop quiet.
In my opinion textmate is the best IDE if you have a Mac. It is highly customizable and you can pretty much do everything you want with it. Plus a lot of developers are using textmate for rails and therefore creating scripts and features that you can import and use.
I'm using Aptana with radrails when I'm on windows, but it's not as good. Plus you can't customize it as much. The other issue is that since it's based on eclipse it's quite ressource intensive and from my experience it's not as stable as textmate.
Aptana has some cool features, like being able to call script/generate and rake tasks directly from the interface, but this is something I could live without.
Aptana RadRails is one of the best Ruby IDEs out there, with Rails support, HTML editors, etc. It is a plugin for Eclipse, and is also supplied standalone.
I use Netbeans because I like the test support and test coverage features combined with the fact that I can use it for multiple languages & environments. They really try to provide a complete environment but I find I still have to step out to the command line a lot - starting thinking_sphinx, running cucumber, tailing logs etc.. so it is never quite comprehensive. It is also slow as hell on my slow as hell laptop.
I used the eclipse rails plugin for a while and it is also pretty good but Netbeans had a pretty good feature surge for 6.5. that won me over.
If you're on Windows you may want to look at "Ruby in Steel"
I've just found it and have not worked with it much nbut the experience so far is good. So if you use VisualStudio for your job this may be a nice addon to help get Ruby into the same environment.
On a mac it is probably not worth it as TextMate is very optimized for Rails development through bundles. I did use AptanaIDE when I was on Windows though. The main problem here is not the IDE itself but the fact that it is not useable (as in snappy enough) on the machine I had. And strangely enough for a Ruby programmer I believe that a program that makes editing unformatted text feel sluggish on a 1Ghz/Gbyte machine is doing something wrong.
Has anyone switched from using TextMate or another powerful text editor to a Ruby IDE? Am I missing anything?
Yes, I recently switched from Vim to RubyMine. (And I also used TextMate before that.) Personally I think the tradeoff is worthwhile, because of how well designed and well implemented RubyMine is. So the quality of the tool makes up for the heavier footprint.
The things I felt I was "missing" with Vim included well-implemented code completion, open files by typing partial filename, click on a symbol to go to the declaration, and a lot of other stuff.
I really like Komod for Ruby and Python development.

What IDE to use for developing in Ruby on Rails on Windows? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What Ruby IDE do you prefer?
I've generally been doing stuff on Microsoft .NET out of college almost 2 years ago. I just started looking at Ruby on Rails. So what editor should I use? I'm using Notepad++ right now but can I get debugging etc. somehow?
Try both NetBeans and RadRails for maybe a week each, then you can find which works best for you. The best advice is to learn your tool. If you are not checking out something new about your editor, something that could potentially save you time (regexp, etc) then you are doing yourself a huge disservice.
I have been using Eclipse/Aptana/RadRails and unlike Gaius have been pretty happy with it.
I recommend the Eclipse IDE for Java Developers from Eclipse Downloads: http://www.eclipse.org/downloads/
Then grab Aptana Studio, following these instructions.
When Eclipse restarts Aptana will have a view, click on rad rails and you are good to go. Just make sure you have ruby installed already, or it becomes a pain to resolve.
Aptana Studio
I use it for all web development - HTML, CSS, PHP, JavaScript, Rails...
EDIT: For full disclosure, I'm biased toward Aptana and RadRails as I know a few members of the original RadRails dev team.
rubyMine is the most full featured IDE for Rails at the current time (2012).
Personally, for rails development I had used Eclipe for several months and then netBeans for several weeks and rubyMine is clearly better than them.
It's great in all the areas that count - code views, search and replace, source control management, testing, debugging and it's got features like viewing a model dependency diagram that are really neat.
It isn't free - cost about $50-$100. This has recently become a key positive criteria for me. Too many "free" products that I invest thousands of hours getting proficient in eventually die and stop being developed but paid products pay for continued development. I've become weary of investing a lot of time and energy into such products only to have them wither and die. Given the hundreds of thousands of dollars one earns from rails development a $100 tool is a bargain.
Despite how much I love rubyMine I still use vim along side it. Sometimes my tasks works better with vim, sometimes with rubyMine.
I've been very happy with E. It's pretty lightweight and supports TextMate snippets and commands, which means you get access to a huge set of Rails-specific helpers.
However, it is decidedly an editor and not an IDE, so you won't get debugging, built in console, etc. But I've found that for Rails projects I prefer a light editor and a shell (like Console) for tests, debugging, etc.
I've been using Aptana/Eclipse/RadRails, but if I were to do it again, I'd definitely try NetBeans. Aptana has been a major headache.
I've never used IronRuby, but that might make you feel more at home.
The Netbeans IDE is a good, all around editor for many languages. I'm pretty sure the 6.5 beta has support for Ruby on Rails, along with Javascript and a few other web languages. It's worth checking out (Netbeans.org).
Sapphire in Steel integrates with Visual Studio.
I mainly code ColdFusion or PHP (and JS/CSS/xHTML), but have dabbled in a bit of RoR. RadRails/Apatana has been great for me, because it's built on Eclipse, which I was already using for my other work. It also integrates with Subversion via the Subclipse plugin.
The Eclipse platform is so extensible that it's worth investing a bit of time in to learn, but then again I like having a single IDE rather than having to switch between different apps.
I briefly looked at Netbeans, but TBH Eclipse just felt better for me, and Aptana itself is great when you come to do anything in JavaScript.
YMMV...
I use Emacs on Windows.
Installing and configuring it to work with rails is a pain though.
I found Geany to be a lightweight alternative (which works on linux as well with little modification), although I am checking out Gedit for features that not present or implemented as well in Geany.

Resources