RubyonRails is similar to most Rails programming languages, it is a server-side web application framework written in Ruby under the MIT license where you can use the command line on Windows or a terminal on Unix-based systems. . All programs should be written and saved in plain text format for easy processing by the compiler and interpreter. Write the following code in the text file to see how it’s 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 file name “first1.rb” and now let’s go to the syntax check function and the function provided to display the syntax check in detail. The following code shows how the code is checked for syntax correctness and returns the result of the check by typing the following code:
$ruby:cw first1.rb
The “-c” flag starts the Ruby syntax checker, while the “w” flag displays the output of the syntax checker. If there is no problem with the code being checked, you will get a “Syntax Correct” result, which means that you can run the code because there are no syntax problems. Type $ruby first1.rb on the command line and you will get the output “The concatenated line is: This is my first Ruby program”
About the Ruby on Rails text editor:
More about text editors that are used with RoR and we don’t discuss VIM or Enhanced Vi. Vim like Emacs is quite efficient and easy to use with RoR as long as it is set up correctly. The great thing about Vim is that it has the nifty way of syntax highlighting in ruby making it easy to trace and debug. It has advanced features, such as having a selective command and an insert mode, the former being the default mode at startup. It is not a word processor, so fonts and other word processor features are not expected.
Text pane:
One of the fastest and easiest to use text editor for creating RoR programs with a simple interface and features mostly suitable for Windows users. Although it is considered a text editor, it is capable of syntax highlighting, searching, spell checking, and recording macros, making it a choice of many developers.
ArachnoRuby:
It can be implemented on both Windows and Unix based systems and is considered to be the native editor for RoR. It wasn’t very user friendly, so it quickly fell out of favor with many developers who resorted to the other specified editors to code.
Reference: Rails sample examples and tutorials
Open Source CMS for Ruby on Rails