How to save the Ruby on Rails program and the main text editor [TUTORIAL]

How to save the Ruby on Rails program and the main text editor [TUTORIAL]

Similar to most Rails programming languages, RubyonRails 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 must be written and written in plain text format so that the compiler and interpreter can process them easily. The first program will give you an idea of ​​the overall syntax of how the program is built and what the compiler does. Type the following code into the text file to see how it’s done:

———————————————-

#this is a sample program

a = “This is”

b = “my first Ruby program”

print “The related row is:”

print a << b

——————————————

How to save a Ruby program:

Save the text file with the following file name “first1.rb” and now we enter the syntax checking function and the provided facility to display the syntax checking in detail. The following code shows how the code is checked for syntax correctness and returns the result of the specified check by entering the following code:

$ ruby:cw first1.rb

The “-c” flag initiates Ruby’s syntax check, while the “w” flag displays the result of the syntax check. If there is no problem with the code being checked, you get a “Syntax is OK” result, which means you can run the code because there are no syntax problems. Type $ruby first1.rb in the command line and you will get the result ” Related line is: This is my first Ruby program “

About the Ruby on Rails text editor:

More on the text editors that are used with RoR and we are not discussing VIM or Vi Improved. Vim like Emacs is quite efficient and easy to use with RoR, provided it is set up correctly. The nice thing about Vim is that it has a nifty way of syntax highlighting in ruby, making it easy to follow and debug. It has advanced features such as selective command and insert mode, the former being the default mode at startup. This is not a word processor, so fonts and other word processor features are not expected.

TextPad:

One of the fastest and easiest to use text editor for creating RoR programs with a clear interface and features suitable mostly for Windows users. Although considered a text editor, it can highlight syntax, search, spell check, and record macros, making it the choice of many developers.

ArachnoRuby:

It is available on both Windows-based and Unix-based systems and is considered the native RoR editor. It wasn’t very user-friendly, so it quickly fell out of favor with many developers who turned to the other code editors listed.

Reference: Rails sample examples and tutorials

An open source CMS for Ruby on Rails

#save #Ruby #Rails #program #main #text #editor #TUTORIAL

Leave a Comment

Your email address will not be published. Required fields are marked *