What is the difference between Ruby and Ruby on Rails? - ruby-on-rails

I have been studying Ruby for the past few days and I have noticed there is Ruby on Rails.
What is the difference between the two? Do they work together? Is the syntax the same?

Ruby is a programming language. Ruby on Rails ("RoR") is a web-application framework that is implemented in Ruby.
So they not only "work together" but RoR depends on Ruby.

Ruby is a general purpose language. Ruby on Rails is a Ruby framework for implementing web applications.

Ruby is an interpreted scripting language for quick and easy object-oriented programming.
Ruby is a programming Language
Ruby on Rails is web-development framework.
You can read more in "Small Discussion about Ruby on Rails".

Just like PHP has Codeigniter , CakePHP and Laravel, similarly, Ruby has Ruby on Rails ("RoR").

Ruby is a scripting language and Rails is a framework which is built using Ruby.
Ruby and Rails are tightly coupled and "Rails is magic emerged out of Ruby". Whatever you write in a Rails application is just Ruby code.
When you run a Rails application, you are just interpreting the Ruby code using Ruby's interpreter.

Ruby on Rails is a library written in the Ruby language. Its popularity prompted many people to take up writing in Ruby to make use of it, which led many people to treat them as inseparable. :)

Related

Ruby on rails web application

If I want to build web application that the server side will be in ruby on rails, I need to learn ruby language in order to that?
I need to mentioned that I am new to ruby and to ruby on rails.
In addition I will be happy for a short explanation what I need to do first in order to do the right steps.
Thanks!!!
Well I just started learning Ruby on Rails and according to my experience I started with learning Rails using Micheal Hartl's guidelines book on Ruby on Rails. Along with that I learned Ruby from Peter Cooper's Beginning Ruby, this helped me learn both the language and Framework with hand on experience.
This should be good to get started with Ruby on Rails. Other than this there are other really good materials like Learn Ruby Hard Way. The best way is to start practicing.

Ruby and Rails or Ruby on Rails [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I understand Rails is a web framework built on Ruby. Ruby is a language separate from Rails which Rails uses. I'm not getting if it is best to use both separately or it is best to use Ruby on Rails.
Or is Ruby on Rails a completely different framework just using Ruby code and Rails code? Could you just install both Ruby and Rails and set them both up together?
If the above is true then what is Ruby on Rails and the benefits of using it in comparison to setting up Ruby and Rails as one?
RUBY => programming language
RUBY ON RAILS => web framework written in ruby
ROR / RAILS => shortcut for RUBY ON RAILS
is this still confusing?
The name "Ruby on Rails" is sometimes shortened as "Rails", or "RoR", which is the same - a web development framework.
You can, of course, use Ruby without Rails, as you can use any other programming language, to build different programs, not only web applications.
You cannot use Rails without using Ruby, because as you wrote yourself, Rails is a web framework built in Ruby. When you build web applications in Rails, you write your code in the Ruby language (there are some other rewrites of Rails, like GRails, which uses Groovy, but this is a different thing).
If you follow the installation guide on the Get Started page, you will see that you first install Ruby for your platform, then install RubyGems (which is a package manager for installing additional Ruby libraries), and then use RubyGems gem install rails command to install Rails with all its dependencies. So you might say that Rails is a library for Ruby.
This installation of Rails then provides a set of scripts, including the rails command, which help you build your web application according to the set of conventions adopted by Rails.
From http://guides.rubyonrails.org/getting_started.html:
Rails is a web application framework running on the Ruby programming language.
I highly recommend making your way through this guide.
Well, it seems many people don't know Ruby but they know Rails. Just as much as I know how to use JQuery without actually understanding JavaScript. So you're not completely off the trail asking this question :)
But honestly, it's not much fun just doing Rails without understanding Ruby. As soon as you understand Ruby you will see more to it than just Rails.
I'd recommend you get familiar with Ruby first and then see if you like the language. If you do you can go further and try Rails as well. If Ruby doesn't suit your language tastes try a different language like Java or Erlang or Python (whatever, doesn't really matter and - as always- depends on the problem you're trying to solve).
If you like Ruby you will also soon learn that there are other nice web frameworks like Sinatra that are a lot smaller and might fit your needs a lot better. Again, it depends on your needs.
Read up on some of the languages, mostly their web sites offer some insight into what they are like and what they are good for. Check http://ruby-lang.org for Ruby!
Ruby is an a language, and Ruby on Rails is an a webframework. It is more like C# and ASP.NET, Python and Django or Java and Spring. So everything what is possible with Ruby is posible with Rails and the other way, everything what is possible in Rails is possible in Ruby, but it can be harder, longer or less clear than using RoR.
Ruby on Rails is web development framework built using Ruby. So it borrows the syntax and some functionality. Ruby is programming language and it is not specific to domain. Ruby can be used in more than one domain. If you want to develop a web app you need to use Ruby on Rails. There are many web frameworks built on Ruby.
For knowing Rails you need to know basics of Ruby. So better to start Ruby first. Once you get the basics you can learn both parallel.
For Ruby refer: http://www.ruby-doc.org/docs/ProgrammingRuby/
For RoR refer: http://guides.rubyonrails.org/getting_started.html
Use RVM (Ruby Version Manager): to install. Link: https://rvm.io/rvm/install/

What is difference between Ruby and Ruby on Rails?

What is difference between Ruby and Ruby on Rails? OK, I know that Ruby on Rails is a Web app framework that is built on the scripting language Ruby.
But why are there options on godaddy.com to choose hosting for Ruby and hosting for Ruby on Rails?
Would it be the same to put hosting for C# and for asp.net?
You can check it here
Well I would guess it's a marketing thing/trick as far as GoDaddy is concerned.
There are other frameworks written in Ruby besides Rails, Sinatra for example, and you can very well write your web applications without framework (your own server, does exactly what you need it to do).
Although, all of that, including Rails, can be named Ruby hosting.
Krule's on the money. The difference is between a language and a framework. Ruby, the programming language, can be used to support any number of web and application frameworks.
By their wording, it's safe to say that it's more of a marketing reason using the ruby on rails buzz word.
Other than that it could mean default support for all the necessary tools for common ruby on rails development scenarios.

How are Ruby and Rails related?

First of all, i want some clarification :)
1) Is RoR like a server scripting language?
2) Can it be used as an alternative to php?
I started learning Ruby from The Ruby Programming Language book and haven't yet come across something which relates to the web. Is Ruby for desktop apps and Rails for web apps?
Thanks
ruby - dynamic programming language
ruby on rails - framework for creating web apps written in ruby
Ruby is an all-purpose scripting language. There are GUI toolkits for Ruby, sure.
Rails is a web framework implemented in Ruby, which can be used to develop web apps - as an alternative to PHP.
Ruby is a language - and one that encourages (some might say enforces) object-oriented programming.
Rails is a framework for writing applications and it uses the Ruby language - hence the term "Ruby on Rails".
Ruby is a general-purpose, dynamic, object-oriented scripting language
Ruby on Rails is a web framework that's written in Ruby
Rails' ActiveSupport module also enhances Ruby in certain ways by adding capabilities to some of Ruby's built-in classes. Rails depends on Ruby, but Ruby doesn't depend on Rails.
Not Really. Ruby on Rails is a web application framework written in Ruby. If you need a comparison, Ruby on Rails is for Ruby what Zend Framework, CakePHP or Symfony are for PHP.
Neither Ruby nor Ruby on Rails are real alternatives to PHP. PHP is a programming language focused on web applications. Ruby is a pure programming language which can be used for creating web applications.
Ruby on Rails offers a more high-level approach for writing web applications with Ruby. Ruby offers some low-level CGI libraries you can use to interact with web servers, but it requires much more effort compared to PHP (because again, PHP is a web-focused language).
For this reason, almost nobody writes web application in Ruby without using a framework such as Rails, Sinatra or others.

A book about Ruby On Rails for the Ruby illiterate?

Is there a book about Ruby On Rails for someone that has little or no understanding of Ruby?
Although Ruby On Rails is a great reason to start learning Ruby, I'd be bored out of my pants if I first have to read a full book on Ruby and then a book about Ruby On Rails.
Something that demonstrates the basic principles of both Ruby and Ruby On Rails would be an ideal intro to this world.
Agile Web Development with Rails (Thomas, Heinemeier Hansson) is a good intro to rails, and introduces Ruby gently along the way, you don't need to know ruby to read it.
http://www.amazon.com/Agile-Web-Development-Rails-Programmers/dp/097669400X
AWDWR is a good place to start. A couple other books worth looking at are Simply Rails 2 and Foundation Rails 2. Veger does have a good point too; without a certain level of Ruby knowledge you will struggle in some areas with Rails.
I would personally recommend checking out why's Poignant Guide to Ruby: http://poignant.guide/ first to get familiar with ruby, it makes it entertaining to learn. Then for Rails I would recommend Agile Web Development with Rails.
Simply Rails 2 By Patrick Lenz is a good Rails introduction for someone with very little Ruby experience. But you will need another Ruby and Rails book or resource to really master both.
A good free alternative is Ruby on Rails Tutorial. It's a work in progress, but even the first 6 chapters helped me out a bunch.
It is wise to first learn the (basics of a) language before using more advanced frameworks in order to fully make use of the framework. Same goes for Ruby and Ruby On Rails.
Personally, I had the same problem. But I found a nice Ruby book (Mr. Neighborly's Humble Little Ruby Book, explaining Ruby in a none/less boring way. I thought it was actually fun to read!
After learning the basics of Ruby you can start looking at the (somewhat) official guides. They are easy to understand and shows a lot of Ruby On Rails basics (and more advanced stuff).

Resources