WELCOME

Book Now For Our WEB DESIGN & DEVELOPMENT  GRAPHIC DESIGN  DIGITAL MARKETING SERVICES

We visualize ideas, turn them in to websites and then take them in to the digital world.

How to Save Ruby on Rails Program and Basic Text Editor [TUTORIAL]

[ad_1]
RubyonRails is similar to most programming languages Rails, is a server-side web application framework written in Ruby under the MIT License where in one can use the command line in windows or a terminal in Unix based systems. All programs should be written and saves in plain text format for the compiler and interpreter to process it easily.The first program would give you a feel for the overall syntax of how the program is created and what the compiler does. Type the following code into the text file to see how it is done:
—————————————-
#this is a sample program
a = “This is”
b = “my first Ruby Program”
print “The concatenated line is:”
print a << b
——————————————-
How to Save the Ruby Program:
Save the text file with the following filename “first1.rb” and we now go into the syntax checking function and the facility provided to show the syntax check verbosely. The following code shows how code is checked for syntax correctness and returns the result of the said checking by typing the following code:
$ ruby:cw first1.rb
The “-c” flag initiates Ruby’s syntax checker while the “w” flag shows the result of the syntax checker. If there is no issue with the code being checked you get a “Syntax OK” result which means you can execute the code for there are no syntax issues. Type $ruby first1.rb on the command line and you get the result ” The concatenated line is: This is my first Ruby Program ”
About Ruby on Rails Text Editor:
More on text editors that are used with RoR and we not discuss VIM or Vi Improved. Vim like Emacs is quite efficient and easy to use with RoR provided it is set-up properly. The nice about Vim is that it has the nifty way of highlighting syntax in ruby making it easy to trace and debug. It features advanced features such as having a selective command and insert mode with the first being the default mode upon startup. It is not a word processor so fonts and other word processor features are not to be expected.
TextPad:
One of the quickest and easiest to use as a text editor for making RoR programs with straightforward interface and features mostly adept to windows users. Though considered a text editor it is capable of syntax highlighting, search, spell check and macro recording which makes it a choice of many developers.
ArachnoRuby:
Is deployable on both windows based and Unix based systems and is considered to be the native editor of RoR. It was not too user friendly so it quickly lost favor of many developers who turned to the other specified editors for programming code.
Reference: Rails Sample Examples and Tutorials

Open Source CMS for Ruby on Rails

[ad_2]

Source by Sid Ray