There are many popular frameworks for online web application development. There are also many different types of frameworks, such as those with a large number of plug-ins that can make you iterate faster (such as Rails), or there are other very simple and low-level ones (such as Flask).
Two relatively more popular frameworks in web application development are Ruby on Rails and Laravel. Both of them are very mature projects and have been on the market for quite some time. Ruby on Rails was introduced in December 2005, while Laravel was in February 2012.
As shown above, Laravel is younger, but Rails does not seem too old, because the community has been innovating and continues to iterate projects by introducing newer, smarter and better tools. Similarly, Laravel grows very fast.
A very small and simple metric for developers is the number of stars in the project on GitHub. Ruby on Rails has accumulated 22,000 in more than 8 years, while Laravel has about 11,000 in just two years. However, since PHP is a more common language than Ruby on Rails, this result is already very good.
We will take a quick look at the various components that are very important when designing and developing web applications, as well as frameworks that are not recommended or recommended for use in these components. The criteria for our choices are based on the focus of our own as developers. In this article, we discuss how easy it is to get started with Ruby on Rails and Laravel.
getting Started
One of our criteria for making choices is how easy it is to get started with a framework. In this case, it is basically to see how quickly you can start writing your web application code.
Rails
Using Rails, you need to install Ruby on the machine, all you have to do is run the following command:
$ gem install rails
With this simple command, it will take all the dependencies of Ruby on Rails and install them on your machine. With most OS X already pre-installed Ruby and Linux is already a Ruby command installed on your machine, this makes it easier to install.
If you want to have an Ubuntu 14.04 LTS service with Ruby on Rails on our cloud service, all you need to do is to start a new server, log in, install Ruby and then install Rails. That's easy.
$ nova boot --flavor nb.2G --image "Ubuntu 14.04 LTS" --key-name MacBook rails-dev $ nova ssh rails-dev Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-29-generic x86_64) * Documentation: / root@rails-dev:~# apt-get update root@rails-dev:~# apt-get install -y ruby ruby-dev make root@rails-dev:~# gem install --no-ri --no-rdoc rails
Then just have everything you need to do when installing Rails. Once it's installed, you just need to create a new application and start playing with it. This is probably the easiest part to do.
$ rails new weblog
In order to start the built-in Ruby on Rails server, you only need to switch to the project path and use the command line to enable the built-in server.
$ rails server
Now you are ready to process service requests and write your web application code. This process, including installing Ruby, is no more than 5 minutes at most. How you have everything installed, and it is likely to start within a minute.
Laravel
PHP is probably the easiest language for web developers to understand. One of the main reasons is that PHP can be used as a language for processing services on the server side. However, due to the scope of this article, we assume that users can run it on their machines or on one server. And it has a powerful introductory advantage that it can be used on most typical hosting platforms.
PHP is installed on OS X by default, and it can be easily installed on any machine. Laravel also has an extremely simple and easy-to-use installer.
If you want to get an Ubuntu 14.04 LTS environment with Laravel on our cloud service, you just need to create a server, install PHP on it, and then simply run the following commands
$ nova boot --flavor nb.1G --image "Ubuntu 14.04 LTS" --key-name MacBook laravel-dev $ nova ssh laravel-dev Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-29-generic x86_64) * Documentation: / root@laravel-dev:~# apt-get install -y php5-cli php5-curl php5-mcrypt root@laravel-dev:~# php5enmod mcrypt root@laravel-dev:~# wget -O /usr/local/bin/laravel / root@laravel-dev:~# chmod +x /usr/local/bin/laravel
This is what you need to do to install Laravel. The next step is to create an application, and the process is as simple as installing Rails.
$ laravel new weblog
If you want to use the built-in PHP development server, all you have to do is run the following command in your application path:
$ php artisan serve
That's it.
Summarize
It is extremely easy to get started with both applications, and it only takes only 5 minutes to set up from scratch. If you have both installed it, it will take less time. This means you spend less time on when to get the development environment, thus spending more time solving practical problems.