Guide to installing and developing Ruby in windows 7 - ruby-on-rails

Could someone be kind enough to point me to a comprehensive manual (preferably a book) that would give me basic, step-by-step instructions to setting up and using ruby in a windows environment?
I'm a complete noob at Ruby, gems and Rails. Is it possible for me to get all-inclusive ground-up instructions on how to make web apps with Ruby in Windows?
So far I've read that rubyInstaller and Bash are a good way to use ruby in Windows; so inclusion of these tools would be a much appreciated bonus!
My biggest difficulty so far is simply getting bash set up so I can install gems and start coding apps against them (again I'm a complete noob!)
Also, what text editor/IDE for windows would be best for me to code in?
I would love an A-Z guide to installing Ruby/gems and making a Ruby-on-Rails app.
Thanks all!

Well, personally I would suggest you to develop Ruby on Rails applications on a Mac or Linux machine. But if you really want it on Windows, there's a one-click installer for Ruby.
http://rubyinstaller.org/
After installing it, you can install gems through the command prompt that comes with the installation. If however, you want a quick start with Ruby on Rails, I suggest you try out rails installer.
http://railsinstaller.org/
There are a lot of good beginner books for Ruby:
Learn to Program
A very nice and well-written tutorial on programming with Ruby. This book is for those who want a refresher on programming and want a nice introduction to the basic features of Ruby.
Programming with Ruby
Also called the PickAxe book, this book provides a complete guide and reference for Ruby.
And for Rails:
Ruby on Rails 3 Tutorial
A perfect step by step tutorial and intro to test-driven development (TDD) using Ruby on Rails. It also covers useful tools such as GIT (version control system) and deployment using Heroku.
Agile Web Development with Rails
This book guides you through a Rails project and examines Ruby on Rails in depth.
As for the text editor, I wouldn't recommend heavy or expensive IDE's, especially when you're just starting out. I would suggest you try out notepad++ which is free and lightweight, or you can try sublime text 2, which has a free evaluation copy, it's a very nice editor and looks like TextMate for Mac.

Related

Ruby on Rails in SpringSource tool suite?

I have been using Grails for some time now, but in school they are making us use Ruby on Rails. I have been trying to find an extension for ruby on rails for STS as there is for Grails, but I have failed. The only thing that comes close is a plugin so i can use ruby code in my Grails app using JRuby. I just want to make sure that a fully integrated extension DOESN'T exist.
If that is the case, what would be the graphical IDE way of developing in ruby on rails, the same way one would use STS for Groovy on Grails development?
(preferably free :) )
Try JetBrains RubyMine, it's an IDE for Ruby and Rails.
Aptana Studio is the best and free IDE for ruby on rails.
Old versions of Netbeans got a good support for language, but no longer updated for new releases.
I like JetBrains.
http://www.easyeclipse.org/site/home/ will allow you to build Rails framework apps. Look in the new install listing and I 'm sure you will find the url for Ruby and Rails. The type name is now under DLT Dynamic Languages Tools. RDT is a bit old and the EasyEclipse uses that.
Try yhis for radrails org.nexb.easyeclipse.radrails of course you know namespaces like this are backward. The best I could come up with for that is http://www.nexb.com/corp/. Or my STS has Juno - http://download.eclipse.org/releases/juno and look under Programming Languages DLT Ruby to get started.
Also these guys might be able to help you https://www.facebook.com/groups/10463298884/

Autocompletion ruby on rails editor for windows

I am looking for an editor/IDE on windows doing autocompletion like eclipse (you start to type and there is a list of possible functions/variables). I tried Netbeans but it does not support network drives, I tried ruby mine, and aptana, but the tab gizmo requires you already know ruby on rails very well to be used.
Is there a Rails editor for windows with autocompletion?
I think JetBrains makes the best IDEs on the market, hands down. Take a look at their Ruby Mine. It's not free, but some things are worth paying for.
Take a look at this thread:
Ruby on Rails Editor for Windows
Aptana RadRails is an extension for eclipse with ruby on rails support and is open source.
RubyMine is also another good editor but it is not free. RubyMine is surely a useful IDE but you might try the open source IDEs first.

Windows Ruby/Rails IDE or editor with autocompletion

I am looking for an IDE with Ruby on Rails autocompletion on windows. Netbeans seems to be ok but he is buggy and the wizard for importing existing project does not work. RubyMine is unable to read files from a network drive (and you must pay for it!).
Is there any Ruby ide autocompleting code with at least the rails API and eventually my project classes?
Take a look at Aptana Studio 3 Beta, that runs on Eclipse. One of it's features, RadRails, provides exhaustive support for both Ruby and Ruby on Rails.
Try e editor. The power of textmate on windows!

IronRuby On Rails VS. Ruby On Rails (Getting Started)

The Scenario
I am a C#/ASP.NET/MVC/Silverlight developer with a few years experience. I'm trying to kickstart my Ruby On Rails learning. I'm currently trying to get a real feel for ROR.
I Want To Know Standards
As a .Net developer, you tend to use a standard IDE (Visual Studio), a few standard databases (SQL Server, Oracle etc.), and a particular way in which to style your web 2.0 application (XHTML/CSS, Silverlight etc.)
'So what are the standard equivalents to these in RUBY ON RAILS!? (IDE, DB's, Presentation Layer Markups)'
Also
What route do I take? I've heard about IronRuby and from what i've read thats nearly complete in terms of converting it for use with Rails (IronRuby on Rails). OR Do I just go straight into using Ruby On Rails!?
What Benefits?
How will I be benefited from using IronRuby on Rails over using Ruby On Rails?
Help greatly appreciated thanks.
IDE
Most RoR developers use a simple text editor (Textmate on MacOS, Scite on Windows) - mostly because most features (Refactoring, Code Completion) of IDEs designed for languages like Java/C# can't be applied that easily on a dynmic language like Ruby. However Netbeans does well so far (on the other hand there is Aptana Studio - based on Eclipse).
Databases
Since RoR does a lot of abstraction it doesn't really matter what RDBMS you use. MySQL and Postgres might be the best choices since they are the most used ones (so you can hope for continuous support). I wouldn't start to chose based on the flamewar about performance, rather on the services/support that come with them.
Markup
The standard would be ERB (similar to ASP inline scripts) combined with (X)HTML. However there are other markups like HAML which might be enough for some projects.
Benefits
Using IronRuby you get access to the .NET framework and interop with other .NET libraries. You might also write some parts of your application in static C#. According to some benchmarks it might be "faster" than native Ruby, not a real advantage though IMHO.
At the moment I would recommend you to get started with regular RubyOnRails - you might be able to switch later on (once IronRoR is stable enough) - if you should still desire to switch.
IDEs:
On Macs the standard IDE is Textmate.
On Windows, there isn't a standard in quite the same way, but I like Netbeans.
Databases:
MySQL is probably the RDBMS most used with Rails, and hence the most supported, but I use Postgres, which is also very well supported, and have had no issues with using it.
Markup
The built in erb works perfectly well, and as it is built in I guess that makes it a standard. You can always use others if you want to.
IronRuby vs Ruby
IronRuby may be almost feature-complete, but I bet there is a good chance that some functionality will go awry, and you may have difficulty tracking down whether it is your code, or IronRuby. I'd be tempted to develop in vanilla ruby, and then port to IronRuby later, if that is an appropriate way to deploy your apps.
See also this question for information about commonly used plugins: Rails Plugins
I would strongly recommend using regular Ruby On Rails - you don't want to have to worry about whether your errors are caused by problems in your code or incompatibilities in the platform you're working with.
The rest of my advice may be hopelessly out of date- it's a couple of years since I did much with RoR, but I'm sure others will mention it if I'm entirely incorrect.
There probably are IDEs with plug-ins for Ruby now ( I'd be looking for some Eclipse plug-ins maybe ) but it's not as regimented as the Microsoft ecosystem. You're working with open-source tools which means that different developers who like different things find solutions that work for them, so there may not be a "standard" as such. I got very accustomed to using Emacs with the ruby-mode plugin which is pretty awesome but there is a learning curve. I took the Pragmatic Programmer's advice to get good at using a text editor pretty seriously on that front and I'm glad that I did.
In terms of databases you may as well use MySQL as that seems pretty standard but I believe you can find an ActiveRecord back-end for a lot of different DB solutions. If you know how to use basic SQL and you get on alright with SQL Server and Oracle you'll be able to get on fine with MySQL though, no question.
With regard to the presentation layer, that's really created through Rails views. The aim is usually to build standards-compliant html and use CSS to style it. I learned a lot from the Agile Web Development With Rails book as a guide to how the platform works as a whole. I know everyone wants to learn everything from the web for free these days, but that book fitted things together in a way I found very practical and represented excellent value for money.
If you like the Visual Studio ecosystem, check out Ruby In Steel from SapphireSteel. It's payware, although there is a free personal edition
Regarding Ruby or IronRuby - the benefit you will get from using IronRuby is only by its seamless interoperability with .Net objects.
If you're planning on using your .Net code from your RoR app, use IronRuby. Otherwise, go for Ruby.
By the way, if you're planning on using IIS, IronRuby on Rails will run more naturally on top of it as well.
Extracted from: http://blogs.msdn.com/b/ericnel/archive/2010/03/25/5-steps-to-getting-started-with-ironruby.aspx
IronRuby is a Open Source implementation of the Ruby programming language for .NET, heavily relying on Microsoft's Dynamic Language Runtime. The project's #1 goal is to be a true Ruby implementation, meaning it runs existing Ruby code. Check out this summary of using the Ruby standard library and 3rd party libraries in IronRuby. IronRuby has tight integration with .NET, so any .NET types can be used from IronRuby and the IronRuby runtime can be embedded into any .NET application.
later in this article:
Step 2 – Install an IronRuby friendly editor
You will need to Install an editor to work with IronRuby as there is no designer support for IronRuby inside Visual Studio. There are many editors to choose from but I would recommend you either went with:
SciTE (Download the MSI): This is a lightweight text editor which is simple to get up and running. SciTE understands Ruby syntax and allows you to easily run IronRuby code within the editor with a small change to the config file.
SharpDevelop 3.2 (Download the MSI): This is an open source development environment for C#, VB, Boo and now IronRuby. IronRuby support is new but it does include integrated debugging. You might also want to check out the main site for SharpDevelop.
Note: as of version 1.1.1 (released: Oct 21, 2010), Visual Studio 2010 has the first-class support for IronRuby (native, rails f/w and much more).

Building Ruby on Windows XP

Has anyone out there got a good set of instructions for building/compiling Ruby from source of windows XP ?
Luis Lavena maintains the Ruby One-Click installer binaries. His blogs and postings on Ruby Forum are definitely the place to start.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/184380
I normally get a binary installable for windows.. much faster if you just need Ruby installed. But you may be modifying ruby source.. anyways..
Update: I ended up compiling Ruby from source today... here is what worked for me
http://madcoderspeak.blogspot.com/2009/06/how-to-compile-ruby-from-source-on.html
I would agree that the binary distrubtion is your best bet for Ruby on Windows, however, like Gishu mentioned, you may be modifying it a bit. If that's the case I would build it from source with Cygwin. This will give you the familiar tool set for building software from source.
However the following thread at Ruby Forum seems to have a very active discussion on building Ruby in Windows using Microsoft's Visual C++ toolkit with some other .NET additions.
Good luck!

Resources