New image on City Cloud: It´s Ruby´s turn!

ozgurCity CloudLeave a Comment

rubyLet’s see. We have already added two new images to City Cloud, a L.A.M.P. server and a Windows Server 2008 alongside MS SQL. We have decided to go for a suggestion a user gave us on Twitter (@sandelius).

So, we have created a Ruby image that comes with all the bells and whistles and packed with Nginx, a fast performing web-server.

Here are the details.

 

 

Ruby is all around

Ruby_on_RailsSpeaking strictly of the server side of things, most of the languages used for web development are PHP, ASP.NET, Java and Python. Ruby is a relatively newcomer language and although it appeared at around the same time as PHP, it didn’t take off until a few years ago.

Thanks to its simplicity you can get started easily and thanks to its influences, you get a robust language that can be used for a variety of purposes. Last but not least, at around 2005 Ruby on Rails appeared which is a popular framework to create websites or web applications and coupled with its excellent package management (packages are called “gems” in Ruby), you get full extensibility.

Performance is key

NginxNginx is a web server and a proxy server. Thanks to its robustness and speed, Its usage has been steadily growing in recent years. It was created by Igor Sysoev.

This is a great choice since it can serve thousands of connections on modest hardware. It’s a fast and proven piece of software, and best of all, it’s open-source which gives anyone the opportunity to peruse the code and even contribute back to it.

Since we are using Ruby, we tossed in the excellent Phusion Passenger also known as mod_rails. Which is great for deploying Rails applications for the web.

Image details

The image is based off Debian GNU/Linux 6.0.2.1 64-bit which is quite stable and up-to-date. We have also installed RVM, which stands for Ruby Version Manager and is great to handle different ruby versions at once. This is quite handy in a production environment since we wouldn’t want anything to break if we update Ruby and something changed (ideally, this is of course, taken care of in a development/testing environment).

There is also Ruby on Rails, a well-known framework that takes full advantage of the MVC model and gives you a lot of productivity tools. But let’s not get dwindled down in details, here is a TL; DR list with all the versions:

  • RVM, version: 1.10.
  • Ruby, version: 1.9.3
  • Nginx (with passenger built-in, installed on /opt/nginx), version: 1.0.10
  • Rails, version: 3.2.1
  • Debian GNU/Linux: 6.0.2.1 64-bit

We have created a test app that you can quickly use to see if everything is working. Just put the following line on your hosts file (usually /etc/hosts on Linux or WindowsSystem32DriversEtchosts on Windows), replace it with your corresponding IP address and then line up your browser to rackexample.com. A simple “Hello World!” html should appear.

your_ip_address rackexample.com

Final comments

Last but not least, let us thank @sandelius for the suggestion and we hope you can all put this image to good use. It definitely saves a lot of time that can be better spent developing or deploying applications.

As usual, since this is a new image, if you find anything odd or that can be improved, we’d love your comments.