Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A website using Ruby alone

Tags:

ruby

I want to write a web application and want to use Ruby. I have no knowledge of Ruby as of now and I want to write this app. to learn Ruby.

Is Ruby alone sufficient to write a web application or Rails need to be included?

like image 626
RKh Avatar asked Mar 04 '10 17:03

RKh


2 Answers

You sound like you're interested in writing something in a barebones fashion.

For that then the Sinatra framework might be more approachable.

You could also use Heroku's service to make the deployment and hosting of your web application simple. I can't overstate how slick Heroku is - it's a masterclass in design and user experience!

like image 96
xyz Avatar answered Nov 28 '22 17:11

xyz


The only thing you need to made a simplest web application with Ruby is rack. It's used by all Framework in Ruby. And all server like Passenger/Thin/unicorn/mongrel are rack compatible.

So you can put the must simplest ruby web application like that :


class HelloWorld
  def call(env)
    [200, {"Content-Type" => "text/plain"}, ["Hello world!"]]
  end
end

But the dynamic system are more difficult. So a framework is really helpful.

like image 37
shingara Avatar answered Nov 28 '22 18:11

shingara