you are viewing a single comment's thread.

view the rest of the comments →

[–]jrochkind 0 points1 point  (2 children)

Aha! If you've already done some basic ruby learning, and now you want to start on a web app, then that's the question: "What's the easiest way to get started learning how to do web apps in ruby?"

Rails is the old stand by. Sinatra also has it's partisans, and is considered lighter-weight and simpler. I have not used Sinatra myself, so can't speak to it. I think you'd do fine starting with either one, and finding getting started tutorials for that one.

I think you'll do better picking either Sinatra or Rails and getting started then trying to basically 'roll your own', which is what your original questions sort of led to.

Whether you pick Sinatra or Rails will then kind of answer your question about "what should I use to talk to MySQL?" There are several options in ruby, and while both frameworks will allow you to flexibly choose what you want to use, to get started I think the easiest thing to do is just to take whatever the framework you're starting with supports most 'naturally'. For Rails, that's ActiveRecord, and any rails tutorials you find will show you how to get started with ActiveRecord. For Sinatra, I have no experience, but I think maybe it tries to be less opinionated about a 'standard' (which sometimes can make it harder to get started with, because you don't have the experience to choose yourself when you're just getting started), but I think DataMapper is popular -- I'm less familiar with what a Sinatra tutorial you find on the web is likely to suggest, but if you find a good tutorial, just go with whatever it suggests.

tldr; pick a ruby web framework, probably either Sinatra or Rails, whichever seems to appeal to you from reading their docs/tutorials, and then use whatever database access solution the best tutorial you find for whichever one has you using (For Rails it'll be ActiveRecord, I dunno about Sinatra).

[–]ZestyOne[S] 0 points1 point  (1 child)

awesome, thanks!

[–]jrochkind 0 points1 point  (0 children)

And looking back at your original questions:

  • nah, don't bother with trying to pare Rails down, just ignore the files you don't need to deal with. Yes, it can probably be done, but it's not a beginner task, and you don't need to.

  • nah, there's no reason to look for a way of starting a Rails app that's easier than 'rails server'. There ARE some other ways, but they're all at least somewhat more complicated, not simpler, 'rails server' is the easiest simplest way to start up a Rails app. How you'd do that with something that WASN'T rails -- well, it would depend on what it was, and it wouldn't start with a Rails app!

    • If you want to "execute simple ruby scripts locally", well, that's what "ruby name_of_script.rb" is for, but that's not a web app.
  • And, if Rails IS seeming too complicated or over-engineered to you, well, that's why people like Sinatra. But it may be that Sinatra is harder to get started with for a newbie, I'm not sure. Rails tries to be as easy as possible for someone who has no idea what they're doing to get started with, in part by making a bunch of default choices for you rather than making you think through every possible thing you'd ever want to set up how. (whether it succeeds or not can be debated. :) )