V
V
Vladimir Chernyshev2011-01-31 05:10:36
ruby
Vladimir Chernyshev, 2011-01-31 05:10:36

Web application in Ruby. Where to begin?

I decided to port one PHP application to Ruby here. Not so much for the purpose of porting for practical use, but for the purpose of gaining experience. At first I started making it as a CGI application, debugging in the console. Then I wanted to see it in the browser, I saw it, I wanted to test it for speed - I was horrified. Decided to look for options. Here is what I found:
1. TCPServer - somehow does not inspire
2. Various web servers and modules for Apache / nginx - I realized that there is not much difference
3. Rack - because of it there is no difference :) as I understood the analogue WSGI in Python
4. Sinatra - it seems that everything is simple and you can’t immediately tell what is missing, it looks like WebOb at first sight or like naked PHP :) I wrote it and immediately realized what was missing - working with forms and linking them to the database
5. RoR - somehow everything is strongly encapsulated, in my opinion it is not good for a first acquaintance, it's like starting to learn PHP with symfony or Yii. It seems to be going, but what is happening under the hood ...
Here I am standing at a crossroads, what to do next. 1 and 2 disappear - raw HTTP does not want to be processed. I hesitate between Rack and Sinatra. Or is it Rails? :-/ What will teach you how to solve various real problems, but at the same time without creating artificial ones? Maybe another option?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
andoriyu, 2011-01-31
@andoriyu

>Sinatra - everything seems to be simple and you can't immediately tell what is missing, it looks like WebOb at first sight or like naked PHP
> like naked PHP
/0
Start with Sinatra, figure out ruby, switch to RoR.
There are also Padrino and Grape, the first is a sinatra with fake whistles, the second is the same, but for creating a RESTful API

A
Anatoly, 2011-01-31
@taliban

You yourself answered your own question.
In fact, you have a choice between 3, 4 and 5
4 - they immediately expressed two minuses, 5 - they immediately doomed them to be unsuitable for use as an acquaintance ... Which option is left?

P
philpirj, 2011-02-09
@philpirj

Substitution of concepts detected.
Rack is an interface between a web server and a web framework. De facto standard. Without it, nowhere.
Passenger is a module for apache/nginx to run Rack.
Thin, Ebb, ... - web servers that do not require apache / nginx.
Sinatra/Padrino/Rango/RoR/… is a web framework.
I would start with Sinatra + Thin.
Then you can connect to Siantra Padrino (almost Rails in functionality, but much more modular and human), and gradually switch to it completely.
RoR still needs to be well known.
For production applications, different options are used. On the current one I have nginx+Passenger+RoR.
It is also worth exploring:
- DataMapper/ActiveRecord/Sequel for communication with the database;
- HAML/Erb for templates;
- Compass/SASS for CSS templates.
Good luck!

K
Kane, 2011-01-31
@Kane

You just didn't understand the beauty of Sinatra. This is a framework that does not force you to choose an ORM and template engine. It doesn't even force the MVC pattern on you (But you can use it). Here is a good example of a Sinatra application.
I can also advise you to look at the Padrino framework . According to their website, it's "The Elegant Ruby Web Framework". And it is true. Padrino, like Sinatra, does not impose the libraries used. So you can choose your own ORM, html and css template engine, database type (not only relational databases are supported) and libraries for testing. At the same time, Padrino has Rails-style generators and, compared to Sinatra, greatly reduces the routine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question