RubyonRails is just like most programming languages Rails, is a server-side net utility framework written in Ruby below the MIT License the place in a single can use the command line in home windows or a terminal in Unix based mostly programs. All packages ought to be written and saves in plain textual content format for the compiler and interpreter to course of it simply.The primary program would offer you a really feel for the general syntax of how this system is created and what the compiler does. Kind the next code into the textual content file to see how it’s performed:
#it is a pattern program
a = “That is”
b = “my first Ruby Program”
print “The concatenated line is:”
print a << b
The way to Save the Ruby Program:
Save the textual content file with the next filename “first1.rb” and we now go into the syntax checking operate and the power offered to point out the syntax test verbosely. The next code reveals how code is checked for syntax correctness and returns the results of the stated checking by typing the next code:
$ ruby:cw first1.rb
The “-c” flag initiates Ruby’s syntax checker whereas the “w” flag reveals the results of the syntax checker. If there is no such thing as a subject with the code being checked you get a “Syntax OK” consequence which implies you possibly can execute the code for there aren’t any syntax points. Kind $ruby first1.rb on the command line and also you get the consequence ” The concatenated line is: That is my first Ruby Program “
About Ruby on Rails Textual content Editor:
Extra on textual content editors which are used with RoR and we not focus on VIM or Vi Improved. Vim like Emacs is kind of environment friendly and straightforward to make use of with RoR offered it’s set-up correctly. The good about Vim is that it has the nifty means of highlighting syntax in ruby making it straightforward to hint and debug. It options superior options reminiscent of having a selective command and insert mode with the primary being the default mode upon startup. It’s not a phrase processor so fonts and different phrase processor options are to not be anticipated.
One of many quickest and best to make use of as a textual content editor for making RoR packages with simple interface and options largely adept to home windows customers. Although thought of a textual content editor it’s able to syntax highlighting, search, spell test and macro recording which makes it a alternative of many builders.
Is deployable on each home windows based mostly and Unix based mostly programs and is taken into account to be the native editor of RoR. It was not too person pleasant so it rapidly misplaced favor of many builders who turned to the opposite specified editors for programming code.
Reference: Rails Sample Examples and Tutorials
Posted By: Sid Ray on https://ezinearticles.com/?How-to-Save-Ruby-on-Rails-Program-and-Fundamental-Textual content-Editor-[TUTORIAL]&id=9992531