As it stands now I'm a Java and C# developer, but the more and more I look at Ruby on Rails, the more I really want to learn it. What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with linux? Is there an ide that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books? Seriously, any tips/tricks/rants would be awesome.
IDE: NetBeans Book: Agile Web Development With Rails Installation: Instant Rails
There's a very solid ongoing series on NETTUTS right now that you may be interested in.
I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux.
Currently I'm dual booting and getting closer to running Ubuntu full time. I'm using gedit with various plugins for the development environment.
A large amount of the Rails developers are using (gasp) Macs, which has actually got me thinking in that direction.
Although I haven't tried it, Ruby in Steel gives you a Ruby IDE inside the Visual Studio world, and IronRuby is the .NET flavor of Ruby, if you're interested.
As far as books are concerned, the Programming Ruby (also known as the Pickaxe) book from the Pragmatic Programmers is the de-facto for learning Ruby. I bit the bullet and purchased that book and Agile Web Development with Rails; both books have been excellent.
Peepcode screencasts and PDF books have also been great for getting started; at $9 per screencast it's hard to go wrong. I actually bought a 5-pack.
Also check out the following:
- Rails Podcast
- Railscasts
- Softies on Rails - Ruby on Rails for .NET Developers
- Rails Envy Podcast
I've burned through the backlog of Rails and Rails Envy podcasts in the past month and they have provided wonderful insight into lots of topics, even regarding software development in general.
The ubber source for anything Rails is http://www.rubyonrails.org/ if they don't have it on the site you probably don't need it.
A quick cookbook is Ruby on Rails: Up and Running you can get it from O'Rielly or search Google for a on-line version. They walk you though the conventions of Rails and use Instant Rails which is ok.
A better Rails book "Agile Web Development with Rails" This is the soups to nuts of Rails. It walks you though downloading and setting up Rails, Gems, everything.
If you want are a Java 'guy' and want a transition book O'Reilly has "Rails for Java Developers" http://oreilly.com/catalog/9780977616695/?CMP=AFC-ak_book&ATT=Rails+for+Java+Developers
I came from a Java background to Ruby to. I found this tutorial helpful http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/to-ruby-from-java/. When it comes to learning rails I cannot say how much I use script\console. It allows you to play with the code and learn how to do things that you are not sure about.
The only book I ever bought was Agile Web Development with Rails, Third Edition http://www.pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition. It was quite useful and provided a good overview of the Rails framework. In addition to that I regular watch Railscasts(http://railscasts.com), which is a great screen casting blog that covers all kinds of Rails topics.
I personally prefer using Linux (because git works better). But, I have also used windows and besides git I do not think the OS choice will impact your programming.
I use netbeans for my IDE and occasionally vim (with the rails plugin). I like netbeans but, I find that it can still be a little flaky when it comes to the Rails support (not all the features work all the time).
I think the screencasts and short books from Peepcode are really good. They have screencasts to get you started and have some as you get more advanced.
There is a site called Softies on Rails that is written by a couple of ex-.NET developers that may be of some use. They have a book called Rails for .NET Developers coming out in the next few months...
I started out on a Windows box using the RadRails plugin for Eclipse and the RubyWeaver extension for Dreamweaver (back during the 1.x days of Rails). Since then I have moved to a Mac running TextMate and haven't thought of going back.
As for books, I started with The Ruby Way and Agile Web Development with Rails. It definately helps to build a background in Ruby as you start to make your way into Rails development.
Definately watch the Railscast series by Ryan Bates.
This looks like a great resource for people like me who are coming from PHP to RoR
http://railsforphp.com/ There's also a book Rails for PHP Developers
Beware, the rails world is a massively frustrating mess of outdated and inconsistent documentation and examples. It is maybe one of the fastest moving and most faddish development communities there is. By the time you learn something it will already have changed. Even the books are not consistent in which version of rails they are talking about. Documentation by blogging! enough said.
I currently do RoR on windows. My advice is to avoid windows if you can. Lots of things don't work and the rails community really really doesn't care about you. The move to Git has really messed me up since it doesn't work very well on windows. A lot of gems will fail because of this (Heroku looks like a cool tool - too bad for me it can't handle window's Git setup). Capistrano is out. It goes on and annoyingly on.
Plus, in the back of your mind, you always wonder when something doesn't work "Is it a rails/windows problem?" I am not sure this is solved by using linux because linux brings its own hassles like constantly having to upgrade all those different dependencies, etc...If that's the kind of thing you enjoy it might be an okay choice for you. Those days of enjoying system fiddling are behind me and I just want to get on with doing my work. I am planning on installing ubuntu on a home machine just so i can get familiar with things like capistrano so maybe my opinion will change.
I'd highly suggest if you are going to do rails dev for any amount of time you seriously consider getting a Mac. If you value your time and sanity it will pay for itself almost instantly. Depending on how you value your time 10 hours of debugging windows/linux setup problems and you have spend as much as a Mac costs anyway.
Rails is a joy compared to what it replaces but it is a bit of a pain in that its proponents skip right past a lot of the boring but important stuff like documentation, compatibility issues and community building. It is way more powerful than other frameworks like Django but I sometimes look over at the Django documentation and community and sigh like a guy with a wild sexy girlfriend looking at his friend's plain but sane and stable wife. But then rails adds a feature and I go "Ohhh shiny!"
IMO the Rails Screencasts are better than the Peepcode screencasts. RubyPlus also has screencasts, mind you, they are bit rough around the edges. BuildingWebApps has a free online course that starts doing screencasts halfway through.
I have found "The Rails Way" by Obie Fernandez excellent and often found myself referring to it when Agile Web Development with Rails didn't seem to go far enough. Obie Fernandez has a decent blog too.
Oh I almost forgot. Here are a few more Ruby screencast resources:
SD Ruby - the have a bunch of videos online - I found their Rest talks SD9 and SD10 to be among the best of the intros. Other rest talks assume you know everything. These ones are very introductory and to the point.
Obie Fernandez on InfoQ - Restful Rails. I've also read his Rails Way book and found it informative but really long winded and meandering and the quality is a bit inconsistent. I learned a lot from this book but felt it was a bit punishing to have to read through the repetition and irrelevant stuff to get to the good bits.
Netbeans is a nice hand holding IDE that can teach you a lot of language tricks if you have the patience to wait for its tooltips (it is a painfully slow IDE even on a really fast machine) and you can use the IDE to graphically browse through the available generators and stuff like that. Get the latest builds and you even have Rspec test running built in.
Bort is a prebuilt base app with a lot of the standard plugins already plugged in. If you download it and play with it and figure out how it is setup you are about halfway to creating your own full featured apps.
My suggestion is just to start - pick a small project that you would generally use to learn an MVC-style language (i.e. something with a database, maybe some basic workflow), and then as you need to learn a concept, use one (or both!) of
Agile Web Development with Rails or The Rails Way
to learn about how it works, and then try it.
The problems with Agile Web Development are that it's outdated, and that the scenario runs on too long for you really to want to build it once; The Rails Way can be hard to follow as it bounces from reference to learning, but when it's good, it's better than Agile Web Development.
But overall they're both good books, and they're both good for learning, but neither of them provide an "education" path that you'll want to follow. So I read a few chapters of the former (enough to get the basic concepts and learn how to bootstrap the first app - there are some online articles that help with this as well) and then just got started, and then every few days I read about something new or I use the books to understand something.
One more thing: both books are much more Rails books than they are Ruby books, and if you're going to write clean code, it's worth spending a day learning Ruby syntax as early as possible. Why's Guide to Ruby is a good one, there are others as well.
As you, I'm a java/C# developer trying to learn more Ruby On Rails.
I'm taking the free online course Ruby on Rails Programming with Passion, is a good introductory course, check it out.
We are using NetBeans as IDE (win/mac/linux/solaris), if you are used to Eclipse or Visual Studio, there is a good chance you will like it.
Path of least resistance:
- Have a simple web project in mind.
- Go to rubyonrails.org and look at their "Blog in 15 minutes" screencast to get excited.
- Get a copy of O'Reilly Media's Learning Ruby
- Get a Mac or Linux box.
(Fewer early Rails frustrations due to the fact that Rails is generally developed on these.) - Get a copy of Agile Web Development with Rails.
- Get the version of Ruby and Rails described in that book.
- Run through that book's first section to get a feel for what it's like.
- Go to railscasts.com and view at the earliest videos for a closer look.
- Buy The Rails Way by Obie Fernandez to get a deeper understanding of Rails and what it's doing.
- Then upgrade to the newest production version of Rails, and view the latest railscasts.com videos.
Wait a couple of months for Learning Rails by Simon St. Laurent, Edd Dumbill to come out in November. That series of books is stupendous, and this book will cover the latest version of Rails.
I wrote a post called "Getting Started With Rails -- What I wish I knew" that many people found helpful.
The basics:
- Agile development with Rails (book)
- InstantRails for quick ruby/rails environment on Windows
- Aptana as the IDE
- Subversion for version control
The online tutorials are decent but scattered. Invest $30 in a book for a more comprehensive understanding.
I really enjoy RubyMine from Jetbrains. It's still in beta but it seems like a very full featured IDE something I miss from many of the other alternatives out there. Also for a simple env I enjoy e the text editor. Plain and simple.
Once you get your environment up and running, this is helpful in giving you a basic app that users can log into.
Restful Authentication with all the bells and whistles: http://railsforum.com/viewtopic.php?id=14216&p=1
I'm currently learning RoR, here's what I've done so far: 1. Read, and followed, SitePoint's "Simply Rails 2.2" 2. Read, and followed, Oreilly's "Rails, Up and Running" 2nd edition.
Those two books are very instructive, and take the same approach in different styles; the second book is a little more aggressive, which is good if you have some RoR knowledge.
As posted above, be extremely careful when reading resources, there are A LOT of outdated videos and articles.
Ruby: I used Learn to program (in a weekend), Ruby Visual QuickStart (believe it or not this QS book was "off the hook" excellent). This took about a week.
Rails: I just went through Learn Rails in one "aggressive" week. Definitely feel I have the nuts and bolts. It's 2009 which I deemed important!
Now I plan to combine a more advanced book with a real project.
IDE: VIM with rails plugin is great if you're a vim addict. Otherwise, try any suggested above.
Of course railscast, etc., are useful for most up to date stuff.
0) LEARN RUBY FIRST. This is very important. One huge advantage of Rails is Ruby: a great language that is very powerful but also marvelously easy to misunderstand. Run through a few Ruby tutorials online. When coding challenges come up on Daily WTF, write them in Ruby. You'll pick it up fast.
1) Go buy the book "Ruby for Rails"
2) Check out a Rails tutorial and subscribe to the Riding Rails blog.
3) Standup an app locally. Don't use scaffolding.
4) When you install plugins into your app, go look at the code in that plugin (in your vendor directory) and learn it. It is one of the best ways to learn Ruby and Rails internals. When you don't understand how something works, post it here and 1,000 people will help you.
As for your other questions:
Yes, you will need a Linux environment to develop in. You can develop Rails on Windows, but that doesn't mean it should be done. Lots of gems aren't up to speed on Windows.
NetBeans works well as an IDE. If you're on a Mac, you'll get street cred for using Textmate.
Good link for learning Ruby : http://en.wikibooks.org/wiki/Ruby%5FProgramming
My company has been developing mavenlive.com, a knowledge management and decision support platform for three years. Over the past few years we've learned a lot about rails and here are some of my recommendations.
Switch to Mac! The tools that are available to you and the development environment on Mac allows you to be far more productive than on Windows.
railcasts.com has a wealth of informative screencasts from beginner to expert. You can always find new and more efficient ways of doing things from Ryan's posts.
Scaling Rails screencasts coupled with NewRelic has provided powerful insight into the performance of our application and allows us to develop effectively while keeping our eyes open for future scalability issues.
Just to +1 Agile Web Development with Rails (though make sure you get the 2nd edition) - http://pragprog.com/titles/rails2/agile-web-development-with-rails
I develop on a Mac and this can soemtimes be beneficial - it's quite a popular platform with Rails developers so many of the blog posts you look at will be mac-orientated. Linux is great too though ;)
Finally - and I have no connection with the company at all - when you do have something you want to put live, heroku is a good choice. Finding a cheap rails host isn't easy so this is a nice starting point. There are a lot of other great hosts out there too though! Heroku does kind of require git for version control (though you can use it on top of subversion).
Best of luck!
Read all the guides at guides.rails.info, starting with Getting Started with Rails They are well written, well organized, and up to date.
An excellent source for learning Ruby and Ruby on Rails is at http://www.teachmetocode.com. There are screencasts that cover the basics of Rails, along with a 6-part series on how to create a Twitter clone with Ruby on Rails.
Railscasts shmailcasts ...
1. Think of some type app that you'd like to develop it.
2. Take 20 minutes to napkin out some user flows
3. Read the first couple of chapters of "Agile Web Development with Rails" with your project in mind
4. Install Netbeans and rails on your windows or mac machine. Either is just the same.
5. Develop your app
6. Consult the bajillion and one online references as you develop.
Rails development on Windows will be extremely painful. You will want to spin up a Linux Virtual Box at the very least. At Hashrocket we are all work on Macs. As for IDE you really can't be Vim in my opinion. Especially with the right set of plugins. I have been very fortunate to work with Tim Pope who writes a lot of the plugins out there for Vim. I have a tutorial on setting up Vim for Rails development on my blog. http://www.adamlowe.me/2009/12/vim-destroys-all-other-rails-editors.html
In regards to learning rails. I would completely disagree with srboisvert. I came from a Microsoft background and the Rails community has been extremely welcoming. I really enjoy the books put out by Pragmatic Programmer (http://www.pragprog.com). Agile Web Development with Rails and the Rspec Book would be good introductory reads. Another thing to keep in mind is you can always jump on IRC and find help.
If you need to get up on the basics of git and vim I use the slidedecks to stay sharp. Mine are available on my slideshare account (http://www.slideshare.net/adamlowe/presentations).
I actually have an article about getting started with rails that should help. The only part of your question it doesn't cover is the OS. Mac is the dominant player here, believe it or not! But I use Ubuntu happily. There are gedit plugins that get you very close to TextMate - in fact, I like gedit better.
If you're on a windows machine and can use linux, that's definitely a better way to go. Rails on Windows has a lot of issues.
I learnt Ruby with the help of Mr. Neighborly's Humble Little Ruby Book. It's an excellent free-to-download introduction to Ruby with lots of examples, which I'd 100% recommend.
I bought the book "Simply Rails 2" by Patrick Lenz.
This book is a great introduction to Ruby and Ruby on Rails.
As for my ruby installation and db, I used Cygwin.
It comes with PostgreSQL, ruby and svn.
I like PostgreSQL because I come from an Oracle
background so it feels more comfortable than MySQL.
The other utility I found really useful was pgAdmin
for accessing the PostgreSQL databases.
The first thing I needed to do was to get gems installed.
I got the gems tar file from rubyforge
wget "http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz"
Once I had gems setup, I installed
rails
ruby-postgres
postgres
rack
I also needed an issue tracking system so I installed redmine.
wget "http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz"
I found that using a UNIX-like environment (Cygwin) was
preferable in my case because many of the tutorials were
taylored for OS X or Linux.
The text editor I use is Textpad. I'm looking for an alternative. I think that vim with the rails plugin might work nicely.
I used to do Java and C# on Windoze.
I'd second these sources:
IDE: Try Apatana RadRails 3 Sneak Peek: http://www.radrails.org/3. Its the closest thing you'll get to Visual Studio. I play with it here and there but still love the lightness of Textmate.
OS: Mac OS gets the most if not all love from Ruby community. Anything else is treated like a bastard child.
Books:
- The Pragmatic Programmers' Guide (the pickaxe book)
- Agile Web Development with Rails
Screencasts:
- Peepcode (pay) is a nice way to pick up concepts quickly
- Railscast (free) is a good weekly way to pick up new gems and concepts incrementally
I come from a non-programming background. I have learned PHP on my own and recently joined a firm that specializes in Ruby on Rails. They have a comprehensive Rails training program, which is flexible enough to accommodate whatever changes we want to implement. Though I am not a rails pro, I would like to share my experience with rails. I hope that it helps.
Here is the path I am following [combined with tools I am using]
- Start with a simple ruby guide. It will help a lot, since entire rails framework revolves around classes and objects.
- Environment and OS are not important. Though I am working on a Mac, I frequently work on Linux and Windows, and I do not face any problems.
- Start with a good book which explains using a demo app. [I am using Agile Web Development with Rails - By The Pragmatic Bookshelf]. There are many other good books as well.
- Once you are done with the application, you will have a good idea of the framework.
- Try to understand the SQL queries generated by Active Record module.
- Go through the Rails Guides. You will find the framework a lot easier.
- Keep practicing.
Few imp points
- It takes years to learn a language completely. So be patient and do not stop learning.
- Go through rails api as when required. [While developing your first app]
- Google the things which you do not understand. People have written great articles on almost all topics.
- Use Stackoverflow :-) [Only when you are not able to find the solution on your own.]
- Load railscasts on your phone or video player. Watch 'em while travelling or in your free time. They are of few minutes each. You will learn a great deal of things and also learn the best way of doing things.
Tools
- Shell [in Mac and Ubuntu]
- Editor [Textmate in Mac, Gedit in Ubuntu and Notepad++ in Windows]
- Firefox with Firebug installed for testing.
Finally I have one thing to say "Keep trying". All the best.
The Book Agile Development with Rails is the number one teaching aid. It's got a nice life-like(ish) application it builds up through the chapters as it introduces you to different concepts. I worked through the examples twice, after which I had enough knowledge to do my own stuff and rely on the rails API documentation (http://api.rubyonrails.org/).
I'm surprised there has been so little mention of Why's (Poignant) Guide to Ruby. Why may not be around anymore but the guide is easy to find on the net (Google points here first) it's a very easy read and provided my introduction to Ruby.
After the guide, I'd recommend either one of the books the others have suggested, or following the series of screencasts at Learning Rails which is how I picked up enough Ruby on Rails to be dangerous. Once you've completed the Learning Rails series. what you want to do with Rails will start to diverge from the general tutorials and that's where Railscasts becomes a wonderful tool. There's not much can be done with Rails that Railscasts hasn't touched on at some point.
Find a nearby Ruby users group and start attending that. I've found that is a great way to meet a lot of people who are passionate about development and willing to teach.
My first suggestion would be to learn a little about symbols first. Rails isn't the smallest framework ever, and while there's definitely lots to learn, most of it will start to make sense if you have at least a little bit of understanding what makes it different ("special") from other languages. As pointed out, there's no exact analog in any of the major languages, but they're heavily used by Rails, in order to make things read straightforwardly and perform well, which is the reason I brought it up. My very first exposure to Rails was also my first time looking at Ruby (well before 2.0), and the first thing that caught my eye was the goofy :things
they were passing around, and I asked, "WTF is that?"
Also, check out RubyQuiz, and read other peoples' answers on that site.
I've found http://railstutorial.org/book to be a great resource for learning Rails
To learn Ruby, read "The Well-Grounded Rubyist" by David Black. It is extremely clear, well-written, and well-organized. The best technical book I've ever read (out of maybe a dozen, since I'm a relatively new programmer).
To learn Rails, read "Head First Rails." They explain how all the mysterious parts work together. Be patient with the silliness and work your way through the examples - it will pay off. (Also, for consistency, use whatever version of Rails they use. You can upgrade later.)
Both of these books assume little to no knowledge on your part, regarding OOP programming and MVC architecture. If you do know a bit, don't skim, because you might assume things incorrectly. (For instance, Ruby objects don't have public attributes, only getters and setters. But you can automatically create multiple getters/setters with a single line like attr_accessor :attr1, :attr2, :attr3
.)
Without a doubt
Agile Web Development with Rails
and
The Rspec Book
and for fun
Advanced Rails Recipies
- I would link to the other two, but Stack Overflow won't let me. See the same site.