6 ms·
Getting Started in Rails is Insane
- ajross 15y agoThis is mostly just picking on someone else's somewhat clumsy screenshot-based tutorial on how to get started with rails. 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.
- dbalatero 15y agoIf you want to learn the core protocols, couldn't you just start off with basics? Static HTML pages, maybe a bit of PHP for a server-side intro? JavaScript on your simple HTML pages? Sinatra if you want to jump into a simple Ruby web-app DSL? 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.
- jshen 15y agoI beg to differ. I started doing rails before things like bundler and rvm. It was easier to get started back then, but without these tools most people found themselves in a pile of shit really fast. 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?".
- ajross 15y agoTo extend your analogy, it's more like: here's how you build a house. Skyscrapers apply all of the same principles in a more complicated way, but this house here solves a very clear real world problem in a way you can understand and emulate for yourself. 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.
- jshen 15y agoSinatra is good for building houses. 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.
- bradleyland 15y agoYou'll never be able to equate Rails development to dead-simple, single-page PHP scripts, because they're not even remotely similar. 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.html http://www.ruby-doc.org/stdlib-1.9.2/libdoc/cgi/rdoc/CGI.htm...
- ajross 15y agoWhich sounds like you're agreeing with me. Rails (I'd extend the argument to most web frameworks, honestly) is simply too complicated for newbies. They should use something else. 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?
- dbalatero 15y agoPretty sure you can just do the following by default on OS X: gem install rails bundler && rails new app && cd app && bundle install && bundle exec rails server http://localhost:3000 http://localhost:3000 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.
- jeremymcanally 15y agoSo, you do a crappy, unfair summarization of an article that, admittedly, isn't a great "intro to Rails," and this somehow gets to the front page of Hacker News? 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.
- smacktoward 15y agoTo get Rails running on a Mac, you simply have to install XCode 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.
- jcromartie 15y agoYou don't need Xcode to develop with Rails on a Mac. You just need to install Xcode to get GCC and various other tools that the Rails install process requires.
- jshen 15y agoYou have to install java first before you can create hello world in your text editor. That's the same as installing xcode. The point is to get a compiler, either the java compiler or the c compiler.
- dougaitken 15y agoI did wonder when I saw the XCode screenshots & such. Homebrew whilst a huge help I'm sure, is just to make things _a bit_ easier. I'm on Ubunutu & know its a lot "easier" than that
- awj 15y agoYeah, those steps are pretty crazy. They also aren't official, and most of the work is in setting up RVM, which you don't actually need to use for Rails. Just about any non-ancient environment that has Ruby provides 1.8.7, which is the minimum you actually need to use Rails. If you want the real guide, look here: http://guides.rubyonrails.org/getting_started.html 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.
- Archio 15y agoNot only did you write this article in an unreasonably sarcastic tone in response to a blog post that isn't the best "intro to Rails", but it's also clear that you clearly lack the programming experience to say that installing Rails is "insane". > 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.
- smacktoward 15y agoRails does run best on a Mac, and there are reasons for that 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...
- bradleyland 15y ago"Rails does run best on a Mac" is an inaccurate statement. Rails runs best in a Unix-like environment, as opposed to Windows. Rails development on Linux is just dandy, and IMO, a step better because you don't have to go out and pick a package manager for all your core libraries. You still face the issue with compiling your own Ruby though. There's some sort of deep seated issue between the Ruby community and distribution packagers that I've never figured out. The version of Ruby that you can install with your distro's package manager is rarely the one everyone uses for development. I think part of this has to do with the break-neck development pace of Ruby in general.
- redidas 15y agoI tried getting into Rails using a tutorial similar to the one referenced in the posted article, and I feel the same way. 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.
- smacktoward 15y agoAt least (he said, heaving a huge sigh) it didn't advise them to run the commands via sudo. That is literally the only nice thing I can say about a "tutorial" that tells people to blindly run code snippets off the net.
- MatthewB 15y agoI've been writing with Ruby on Rails for about a year now. When I first started I had not coded much for a while so I was very rusty at coding in general. In my opinion, rails had an extremely high learning curve. It took me a long time just to get the environment up and running since I ran into a bunch of installation problems on a pretty standard setup. 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.
- olegp 15y agoAlthough this is a somewhat sensationalist blog post, I agree that web development should be easier. Web IDEs like Cloud9, Akshell (www.akshell.com) etc. and platforms with built in dependency management features should make it possible in the not so distant future.
- owenjones 15y agoThis is incredibly pointless. 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.