What is difference between Ruby and Ruby on Rails? - 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.

Related

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 exactly is Ruby on Rails?

I've looked up plenty of information on Rails, but I still can't say I'm quite sure of what it is. If I'm developing a web app, what functionality would I get that I couldn't from html/js/php? Would every project benefit from rails, or do you need a certain goal in mind?
Ruby on Rails is a web application framework. Technically there isn't anything that Rails can do that HTML/JS/PHP can do. The point of Rails it to make developing websites easier, faster, and hopefully more maintainable. If you are familiar with PHP, then Rails is somewhat equivalent to Symfony, Kohana or Yii.
I'd recommend trying out some of these tutorials if you haven't already.
Rails for Zombies - you won't even have to setup rails on your machine
Ruby on Rails tutorial book
Railscasts - for once you get more into it
Ruby on Rails is a web framework built for programmer productivity and happiness. It's built on top of the Ruby language which means you get access to all the cool libraries ("gems") other people have written such as file upload libraries and ones that interact with web services such as AWS.
You use HTML and JavaScript with it just like you would in every other web framework out there. The difference? It's not built on top of a hack of a language such as PHP. Good Ruby code is elegant and very readable, and you will find this out in your usage of the framework.
The Getting Started guide explains it very well: http://guides.rubyonrails.org/getting_started.html.
What it is is a framework. It's a set of APIs, a toolkit if you may, to build web applications.
Ruby is a programming language like Python, Perl, C, C++, Java, C#, PHP etc. It's closer to Perl and Python than to other due to its interpretive nature (a scripting language if you may).
RubyOnRails is a framework built on top of Ruby to build web apps. Arguably like Servlets is used to build web apps on Java or .Net is used on C#, or Django on Python or CakePHP on PHP etc. It's an amalgamation of APIs, code generation tools, testing code etc put together.
It's popular because of it's elegance, it's choice of following conventions over configuration (you write less config code or glue code). Once you get the hang of it, there is less ceremony involved before you get from idea in your head to working production application with RubyOnRails (popularly referred to as Rails).

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.

What is the difference between Ruby and 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. :)

Options for distribution of an offline Ruby on Rails application

I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.
This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...
My understanding is, that in order to run an instance of this application on somebody else's computer, they would need to install ruby on rails, and a webserver (or webrick, perhaps), as well as my application code.
I am just curious if there are any other options for distributing my application as a standalone app, or perhaps just a simple way to package up a web browser and ROR together with my app for a simple, one-step install?
I have personally never needed to do this. But, I have ran across this tutorial http://www.erikveen.dds.nl/distributingrubyapplications/rails.html that I think will be helpful. The tutorial covers how to actually convert a rails app into a standalone exe file.
Note, Slingshot appears to be a dead project (see comments). I'll leave this answer here for historical purposes and the off-chance that it comes back
Joyent's Slingshot might be a good bet.
Joyent Slingshot allows developers to deploy Rails applications like a standard desktop application, which work online and offline (with synchronization), have drag and drop, and interact with all the other desktop applications.
With Joyent Slingshot:
Create a hybrid Web/desktop application
Synchronize online and offline data
Use the same code for online and offline application(s)
Deploy and update your application easily
Drag into and out of application
Here are some further links to help with your evaluation and/or to help you get started:
Introducing Joyent Slingshot
Basic application walkthrough
Slingshot wiki
The way most people ship ruby programs, including Rails webapps, as a standalone exe is via rubyscript2exe. They describe how to package a Rails application at http://www.erikveen.dds.nl/distributingrubyapplications/rails.html. Ruby, Rails, and all the associated libraries will be included in the EXE file.
As others mentioned, Ruby is not necessarily Rails and if you really want an easy way to write a distributable GUI application in Ruby, Shoes is an excellent place to start looking.
Gears on Rails maybe?
You could always consider compiling your Ruby to JVM byte-code (via JRuby) or .NET byte-code (via IronRuby) to distribute to people who have those virtual machines and don't want to install a Ruby runtime.
You might want to check out Shoes for building desktop applications in Ruby. Rails really is tuned for building websites.
You can include Ruby on Rails by freezing it to the version of Rails you want to use in your project. They call this Freezing. The user will not have to install Rails to use your application. You can do this with any library you use in your project. If the project uses a library, just place it under the Vendor folder in your project. Then use a tool similar to what #Josh answered with to package it.
You will need a web server to run the project though. There is no way around this. Ruby on Rails is just like ASP.NET in this regard, in that it is a server side framework. The server runs the code and outputs the HTML to the browser by using the Rails framework.
Unfortunately, you may have picked the wrong framework to do what you want. Instead of Ruby on Rails, you may want to check out Shoes, which is a framework for developing GUI applications using Ruby.
You do not specifically say whether it is supposed to be a GUI application or not. From the other answers, I would guess so.
Therefore, you need to clarify what your goals are. RoR is a specialized framework for web applications. If your goal is to learn RoR, I'd say to get yourself some inexpensive web hosting and make yourself an app. If your goal is to learn Ruby, not necessarily Rails, then Shoes, IronRuby, JRuby, MacRuby and others may be good options to look at.

Resources