How to update RubyGems?
Answer:
To update the the RubyGems installed in Ubuntu, enter the command below:
# sudo gem update --systemNow
That's it.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to update RubyGems?
Answer:
To update the the RubyGems installed in Ubuntu, enter the command below:
# sudo gem update --systemNow
That's it.
Install RubyOnRails in Ubuntu
Answer:
In the last article, we talked how to install Ruby in Ubuntu. Now, we are going to install a very popular web framework for Ruby - RubyOnRails.
Firstly, you need to install RubyGems, a gem is a packaged Ruby application or library.
# sudo apt-get install rubygems
Then, we use the gem command to install rails.
# sudo gem install rails
That's all.
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