Ruby and Rails or Ruby on Rails [closed] - ruby-on-rails

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/

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.

What basic gems i need? [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 11 years ago.
hi im new to ruby on rails application development im just wondering what basic gems i need for my ruby on rails im a beginner and don't know what gems are important for a beginner like me
thanks please help
I agree with Dave (and certainly with Alex about railscasts!)
However it's good to know what's ahead and what's good to pick, so from experience I can recommend the following (when you are ready):
Initially:
rspec for testing. Get into testing asap!
authlogic for authentication. "Login"
simple_form for views. (Saves hair extraction ;) )
mysql2 for your database or just use sqlite
As needed:
heroku If you are deploying on heroku
resque for background tasks.
activeadmin for instant admin CRUD against tables.
Then (more experienced developer):
devise for authentication. Does everything.
cancan for user roles. Great options for simple roles.
haml for views. Popular approach for cleaner code by removing <'s and >'s and
ruby end's and html </closing> tags
pg for Postgres
You will also find this very helpful: https://www.ruby-toolbox.com/
I highly recommend pry -- it's unbeatable for exploring your code and data. In Rails it's a pleasure to use as a rails console replacement.
I also recommend a gem of a book (see what I did there?) called Rails AntiPatterns which will help you start writing clean Rails code. And The Rails Way, if you haven't already.
There are so many gems, that it's best to start looking only when you have an itch you assume someone else must have already scractched.
Before using any gems I'd recommend you to go ahead and run this code in your Console.
rails g scaffold Foo bar:string faz:integer
This will generate a whole bunch of files in your project.
Looking through the generated code helped me understand the fundamentals of a Rails application.
But to answer your question:
It really depends what functionality you want to add to your application.
I would also recommend to watch the Railscasts video tutorials. Ryan features a lot of gems and also explains and compares them to similar ones.
Generally I'd suggest picking up a good book
and working through it.
If Rails is what you're interested in, then check out;
Ryan Bigg's "Rails 3 in Action" (covers 3.1 in depth)
Sam Ruby / Dave Thomas / DHH's "Agile Web Development With Rails" (using rails 3.0)
Obie Fernandez' "The Rails Way"
They will introduce you to the design patterns and workings required to build apps in Ruby and Rails.
And consequently, along the way, you'll find out how and when to use various different gems.
Asking what gems to use, without a context doesn't really get you anywhere, unfortunately.

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.

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. :)

Resources