Getting Started in Rails is Insane
jcromartie.tumblr.com
jcromartie.tumblr.com
To get Rails running on a Mac, you simply have to install XCode, run "sudo gem install rails && rails new blog." The included system Ruby will work OK for Rails dev (it's what I use 99% of the time just for convenience). If installing XCode and editing things freaks you out, then you may not be cut out for the level of coding required to actually use Rails. Things like Try Ruby, Shoes, Scratch, etc. exist for a reason; trying to shoehorn people into Rails too early is a Bad Thing™.
If you don't have a Mac, you can get running on Windows using RailsInstaller. If you're on Linux, I think it's fair to assume you know enough to install Ruby and friends with your package manager.
TL;DR: It's not crazy to get started with Rails; it's probably far less painless than most frameworks these days. And pointing to a fairly poorly written, overly verbose getting started guide and saying "ZOMG STARTING WITH RAILS IS KARAZEEEE!" is just stupid.
Why?
Seriously, even in Java you can get to "Hello World" with just a text editor. You don't need to download Eclipse first.
If installing XCode and editing things freaks you out, then you may not be cut out for the level of coding required to actually use Rails
I love the idea that someone who prefers emacs or vim over an IDE like XCode is insufficiently l33t for the awesomeness that is Rails.
And why do I need a C compiler to work in Ruby, anyway? I assume it's to compile your own version of Ruby. (Which is another way the Java comparison doesn't work -- you need the Java tools to compile your own code, not to compile Java.) But why on earth would a newbie want/need to do that?
And why do I need a C compiler to work in Ruby, anyway?
I'm not a Ruby programmer, but I'm betting it's the same reason as in Python: to be able to use libraries that have pieces written in C for speed.If your project gets up to very large scale things are probably different, but there's no need to deal with that in a "Hello World"-type tutorial.
Actually, django is worse if this tutorial is correct.
http://programmingzen.com/2007/12/22/how-to-install-django-w...
They are telling you to install a binary precompiled library. I much prefer having my dependencies managed as they are in bundler than downloading libraries manually and installing them.
I know there's been some bad blood between the Ruby and Debian communities about Debian package maintainers not accepting bleeding-edge versions of Ruby software into the Debian repos; that may have been why Ruby went off and built its own set of package managers.
1. I develop on a mac and deploy on different linux distros. It makes more sense for me to have a single system for managing ruby dependencies than to do it with 3 or 4 different systems that work differently and may not be fully compatible. Plus, with bundler and rubygems I'm not stuck on whatever version the distro decides to support.
2. If I install something like the mysql driver manually or with apt-get, and then a year from now I'm no longer around and some other developer checks out the code ... how do they know which versions of the libraries were used? With bundler all versions of all gems are checked into version control. This is a big win, and they can get a system with exactly the same versions of everything with a simple 'bundle install' after a clean checkout!
Edit: 3. Also, there are likely to be C based python libraries you want to use that aren't maintained by your distro. Now you're in a situation where you are mixing multiple dependency management systems which gets ugly fast.
If you wish you can use JRuby and you don't need a C compiler.
Is Ruby really so slow that you can't do "Hello World" in Rails without leaping into a faster environment?
Java for OS X Lion: 62.53 MB; includes all basic tools to write Java code
Xcode for OS X Lion: 1.68 GB; is just a prereq for getting set up for cutting-edge Rails development
But Java and Xcode and Rails are really apples and oranges and pomegranates.
Yes, you can `sudo gem install rails && rails new blog`.
But that's not going to get you a suitable environment for any standard Rails project today. Especially not if it involves other people.
Installing things from gists using cURL, RVM, 1.9 (Lion still comes with 1.8), juggling gem updates, bundler, cloning git repos (submodules for plugins, etc.), etc., are all totally par for the course.
rvm: managing ruby versions. This is a big win, and you offer no better way to do this.
bundler: managing dependencies. This is a big win, and you offer no better way to do this.
I'm not saying the Ruby ecosystem is perfect, but a lot of the problems are engrained in Ruby culture. Losing the problems will likely mean losing some of benefits of that culture along the way.
If you want the real guide, look here: http://guides.rubyonrails.org/getting_started.html
It's still pretty long, but most of that is introducing important Rails concepts and walking through a hello world.
There seems to be a tendency in the Rails community to go nuts with packages and blindly follow quickstarts. I've never appreciated it, but it seems like the Rails developers have been rather careful to avoid falling into that trap.
gem install rails bundler && rails new app && cd app && bundle install && bundle exec rails server
Whether or not you install XCode is specific to Mac, and always will be an issue due to lack of gcc by default. If you're on Ubuntu, it should be pretty easy to roll:
apt-get install ruby rubygems (or something to that effect)
IIRC, you don't even need a database created/migrated until you decide you need one.
I definitely think that Rails is harder to jump into now as a beginner due to the framework's evolution. However, these startup steps the author rants are all mostly "best practices" and not really necessary to jump in and start coding.
For me there was too much too fast. Something that was supposed to be easy was complicated. "Just run these commands" and it all works itself out.
I got as far as creating static pages, and a basic user authentication page, and quit. There was just too much to remember at first, and I didn't know what anything was actually doing. I was just mimicking the actions of someone else who did.
That is literally the only nice thing I can say about a "tutorial" that tells people to blindly run code snippets off the net.
That being said, I love RoR now. Now that I understand how gems and bundler work it is easy to add new features to my apps within minutes. I installed an entire admin panel in about 15 minutes. For someone with no coding background, I just don't know how they would get past the learning curve. I'm not saying it's not possible, but it would be extremely difficult.
But the broader point is, I think, pretty valid. Modern web development is a huge mess. Tool upon tool upon tool buries the core protocols, to the extent that newbies never even get a hint about how simple this all really is. It looks like voodoo.
Pretty much all frameworks seem complicated to me next to the core protocols. However, that's why I use them: they abstract the core protocols that I already know how to use, and make me more productive. If you're just getting your feet wet, don't jump into abstractions, and get down to the basics.
I think the mistake people are making is assuming that what is best practice for a trained professional should also be the starting point for someone that is just learning to do web dev.
It's like saying, "building skyscrapers is too hard, there's all this stuff you have to know. Why can't I just do it like I did when I was a kid and stack bricks on top of each other?".
Now, picture a world where all the "serious" people with "mindshare" spent all their time explaining why skyscrapers were the best thing in the world, and how only PHP-using dinosaurs would every build "houses" any more. And fast forward to the inevitable attempt to explain to construction newbies how to build skyscrapers from scratch.
So I ask you: where are the houses of modern web development? I don't see any. More to the point: I see some, but they're "old" technologies the cool kids don't use any more. Everyone freaked out about Rails not scaling up, but it also fails to scale down to the level of a new developer.
I haven't seen anyone here say that rails is the right solution to everything. However, I have found that it is the right choice for the vast majority of web apps I've built. For most things you will want a testing framework, a model layer, dependency management, form helpers, routing and linking apis, etc, etc, etc.
And if you're doing a medium to large size, consumer facing web site, you'll want an asset pipeline.
You want dead-simple, single-page web development in Ruby? Check out CGI [1]. Once you get in to Rails, all examples are completely incongruent, because you're dealing with a large(ish) framework. When you compare Rails to a framework like Symphony or CodeIgniter, the learning curves and tool stacks begin to compare a little better. I don't know what version of PHP ships with OS X, but I know the web is full of HOWTO articles explaining how to get a more sensible stack of PHP version x.x.x on OS X. Many PHP devs are how using Nginx with PHP-FPM, which isn't there by default. Then there's the question of versions. Does a version manager for PHP even exist? What happens if you need to run an old PHP 4 application?
Those questions are rhetorical. I'm sure they all have answers, but that's not my point. My point is: you end up with the same problems on a different stack once you move past trivial examples or start dealing with other people's code.
IMO, Rails scales downward just fine. A new developer shouldn't jump right in to Rails development. MVC is too complicated for someone who can't handle basic tools If you're uncomfortable with tool chains like XCode, Terminal, RVM, and Bundler, then you have some learning to do. You don't get to be a doctor without understanding anatomy, and you don't get to be a programmer without understanding the fundamentals.
1 - http://www.ruby-doc.org/stdlib-1.9.2/libdoc/cgi/rdoc/CGI.htm...
So I ask you: if a platform is so complicated that it simply doesn't support new developers, can it survive? By analogy, is Rails turning into the C++ of web development?
Beginning programmers should not start with large frameworks. Period.
"So I ask you: if a platform is so complicated that it simply doesn't support new developers, can it survive? By analogy, is Rails turning into the C++ of web development?"
This is so tough to answer. From my perspective, the question is completely absurd. It's like asking "if a semi-tractor-trailer is so complicated that a new driver simply can't drive it, can it survive?"
Programming is conceptually difficult. Even with the best tools we have today, and probably the best tools we have tomorrow, programming will remain a challenging task. As the problems become bigger and more complicated, so do the tools. Rails is large, so there is a lot to learn. The notion of a framework is that we should avoid solving the same problems over and over again. People are often frustrated that it can take a year or more to really learn the Rails framework, but it would take orders of magnitude more time to solve all the same problems Rails solves if writing from scratch.
The more relevant question is, "What problem are you trying to solve, and does the Rails framework help you do that?"
A garden spade is fine if I want to plant a few daisies, but if I want to build an inter-continental pipeline, I'm going to need something a little more robust. I'm also not going to stick a 16-year-old driving permit holder at the helm of a multi-billion dollar tunnel boring machine.
Yet every time I need to look at Rails, I run screaming because of the huge, steaming mess that learning it has become.
The point about C++ was real. It's exactly the same feeling I get when I bump into boost nerds who honestly think template metaprogramming is the path to the future.
I do web dev daily, so rails is great for me, but whenever I have to deal with someone's chef deployment setup my head starts to hurt. But they do devops everyday and chef makes their life easier so they get a lot of value out of it.
> If you want to use Linux, sorry, you’re kind of on your own.
Rails does run best on a Mac, and there are reasons for that. However, it can also run on Linux or Windows with cygwin.
> Open the Terminal. Don’t worry about what it is or where it resides on your computer.
This is where I seriously doubt your ability to have a professional opinion on that. If you've never used the terminal and you're so unfamiliar with it then you're scared the author might be using an unfamiliar program, then how are you expecting to get started with a web framework that works exclusively out of a command line?
> Install a package manager. What’s that, you ask? Don’t worry about it!
Once again, if you don't know what a package manager is, maybe you should learn about things like this first- RVM works wonderfully with Rails gems, but you don't appear to have anywhere near the amount of technical knowledge to know that.
> Now quit the Terminal and re-open it for some reason.
Yes- you have to restart Terminal before using newly installed frameworks. This is basic terminal knowledge.
> I want to see people programming, and learning to program.
Excellent! Yes, the article you responded to isn't great, especially if the reader has little programming knowledge. But slamming Rails because it requires some basic skills around Terminal is inappropriate and reflects upon poor technical awareness.
It seems like an odd decision to make the platform for your server-based application run best on an OS that has zero server marketshare...
What I'm saying is that a "first steps to Rails development" tutorial requires you to gloss over things like the terminal and commands, all in the name of expediting the process of getting to the framework (the supposed goal).
Yes Rails was hard for me to learn at first, and even a few years into the framework I am still learning things all the time. Just like anything significantly complex.
And criticizing the XCode installation is completely missing the point.
I'm on Ubunutu & know its a lot "easier" than that