Installation
$ sudo apt-get install ruby-full build-essentials
$ sudo apt-get install rails
$ sudo apt-get install vim-ruby
$ sudo apt-get install vim-rails
The same could be accomplished via the synaptic package manager in a more graphical environment by selecting System->Administration->Synaptic Package Manager. Then searching for the packages ruby and rails and selecting both and clicking "Apply".
Soon after installation I went ahead and wrote the following program to test the ruby language. The benefit of installing vim-ruby and vim-rails is that it helps in using vi with syntax highlighting for ruby and rails.
testString="aaabbbbc"This completed the test of ruby in Ubuntu. More about ruby over rails later.
if testString=~/^a*b*c$/
print testString, " is in the language a*b*c\n"
else
print testString, "is not in the language a*b*c\n"
end
testString="aaaaacb"
if testString=~/^a*b*c$/
print testString, " is in the language a*b*c\n"
else
print testString, "is not in the language a*b*c\n"
end
No comments:
Post a Comment