Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Install Ruby in Ubuntu

Answer:

To install Ruby under Ubuntu, you need to type the commands below:

# sudo apt-get install ruby-full build-essential

The above command will install more than the Ruby interpreter, but they are useful when you want to play with RubyOnRails later.

Multi-line string in Ruby

Answer:

To declare a multi-line string in Ruby, it is as easy as the following.

sql = "
        SELECT *
            FROM `user` AS u
            JOIN `company` AS c
                ON u.cid = c.id
             WHERE u.id = 8
"

puts sql