My Articles
Simple Ruby Tip – Return Multiple Values
September 16, 2017

Return Multiple Values As many of you already know, everything in Ruby is an object so, when you create a method, it actually returns an object. What I want to show here is how to return multiple values (multiple objects) out of a Ruby function. Unfortunately Ruby does not support the returning of multiple objects, […]


Check system endianness using Ruby Hello folks, today I’d like to share with you a simple way to check the endianness of your system using Ruby and it’s based on the “pack” method in Ruby’s Array; pack simply represents the content of an array in a binary sequence according to a directive given to it as […]

Ruby tip of the day
July 4, 2014

Hi folks! Have you ever thought about removing new line “\n” and all whitespaces  from a string? The magic we need is in  Ruby  “gsub” function: " My string\n ".gsub("\n","").strip the first gsub removes all newline characters while the second one removes all whitespaces; so the result will be   Mystring isn’t it simple? If […]

Linux tips
Install RMagick gem
July 31, 2012

Hello to everyone, today, since I couldn’t find any Dicom viewer for Linux, I had to install RMagick together with ruby-dicom. While installing RMagick  gem, I got this error:   checking for Magick-config… no Can't install RMagick 2.3.0. Can't find Magick-config in So, since the ImageMagick default installation on my Ubuntu is not complete I […]

Rails 3 and Web Services
July 21, 2012

Hello to everyone, Working for a new company brings a lot of new excitement and also a lot of new stuff to learn; now it’s Rails 3 and Ruby moment… So, because of a project I’m following, I had the need to learn how to get something out of a web service using Ruby… Well, […]

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.