Gifting A Brief Sleeved T Shirt

From openn
Jump to: navigation, search

Ruby on Rails is really a web application framework.

Rails may be the framework, Ruby may be the language.

Designed by David Heinemeier Hansson in 2005, it's become renowned in the Internet startup world because of its adoption by a number of the leading "startups" of our time, including Stripe, Uber and Groupon.

If you want to figure out how to program in Ruby on Rails, this tutorial should give you an overview of what to do. I won't get into specifics because I just want to give you a concept as to the structure of an application. In the event that you follow what I propose, you should more fully understand how these applications work.

Web Applications

All software applications work in the same way -

Data is inputted
Data is processed
Data is outputted
The way the data is inputted and processed would depend on the platform the application runs on. How it is outputted depends on your application.
The difference with web applications is that their logic runs on a server, with the data IO being passed through the web (specifically, the HTTP protocol).

The complication of web apps is that you require the ability to accept inbound data, and return responses. That is handled by a web server program (NGinx or Apache). I'll explain this in a minute.

Software Stack

When you create a software application, you have to consider the "stack" on which it runs.

The "stack" is all the software required to run your application. In the wonderful world of desktop games, for example, the "stack" may include famous brands DirectX or perhaps a particular graphics driver.

The main hold-back for would-be web application developers is understanding how the "web" software stack works. Web works similarly to native applications, except for one distinct difference - stateless.

The "Internet" operates under the HTTP protocol. By nature, that is known as a "stateless" protocol - each request you send is known as independent to the last. Unlike stateful protocols (which retain state), stateless protocols need to rebuild the application's state every time.

Whilst this means nothing to most people, the point is that if you're going to develop a web based application, you should employ a framework or technology set which makes the stateless nature of HTTP as integrated as possible. Most pertinently, you need an authentication system which rebuilds the user's session on every request (I'll explain this in a second).

Ruby vs PHP

Ruby (the language) is comparable to PHP - they are both procedural and both are employed heavily on the Internet.

The primary difference between Ruby and PHP is that PHP is accessed directly on the client-side, Ruby requires a proxy.

Applications such as WordPress are built with PHP because it's free, open source and can be operate on any LAMP (Linux Apache MySQL PHP) server (which is basically all of the shared hosting in existence).

The idea with Ruby is that it's a LOT more temperamental than PHP - it requires running processes to greatly help it operate and can often neglect to start if any issues arise.

Basics

To get started, you need three things:

An IDE (Integrated Development Environment)
A Ruby-Compatible Web Server (Heroku)
Ruby, Rails & GIT Installed ON YOUR OWN System
I'll explain how it operates.
An "IDE" is a text editor having the ability to discern the code you input. I currently use Atom (free) from Github. It is possible to download it from Atom.io.

The IDE lets you write the code. Whilst you're free to use a standard text editor (Notepad or Notepad++), it's far better to use a system such as for example Atom and even Visual Studio, as to gain the entire functionality of the language (linting etc).

From here , you'll also need to install Ruby, Rails and GIT on your own development system. Ruby is the programming language (nothing works if you don't have it), Rails may be the framework which allows us to create the web based application, and GIT is the SCM (Source Code Management) system we shall use to push our code to our server.

For server technology, the easiest is by using Heroku (Heroku.com) - a completely managed system. You can find started free of charge, with upgraded capacity, speed etc added at extra monthly cost. If you're comfortable setting up your personal server, you may wish to use the likes of DigitalOcean.

It should be noted that shared hosting does not work for Ruby based applications. You not merely need GIT access (typically through SSH) however the server is also necessary to run Ruby as a running process. This cannot be done with shared enviroment (unfortunately).