As mentioned previously, in this example the file will be located in the ruby folder in the desktop, so you can navigate to the folder using console commands and then execute the file: cd C:\Users\sdkca\Desktop\ruby To execute a ruby file, you only need to do " ruby path-to-the-file-and-filename" and you're ready to go. The previously created file will contain the following code: puts 'Hello world ! The date and time now is : ' + ("%d/%m/%Y %H:%M") In this case we are going to create a folder in the Desktop with the name ruby and we are going to save the hello.rb file inside. Now get started with your Hello World in Ruby, create a file named hello.rb wherever you want. ![]() The environment variable ruby should be available everywhere in your console, and the previous command should output something similar (with the version of your distribution) in the console: Before continue, check in your command prompt ( cmd.exe) if you've succesfully installed ruby executing the following command on it: ruby -v You can execute Ruby code now in your computer, so let's write some code. Proceed to install and wait till the wizard finishes.įinally you'll be able to run Ruby code and use its tools in Windows easily ! Hello world However, in the Installation Destination and Optional tasks do not forget to check all three options in order to use ruby easily on your computer. Now execute the installer and proceed with the installation of Ruby for windows as you usually do with any installer. Some older packages may not be compatible with newer versions of Ruby and RubyInstaller. ![]() However, not all packages (gems) are maintained. These provide a stable language and a extensive list of packages (gems) that are compatible and updated. If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby 2.2.X installers. You can download the most recent version not in the official website, but in in the downloads area. This is a self-contained Windows-based installer that includes the Ruby language, an execution environment, important documentation, and more. You'll need to install a Ruby distribution for Windows in your system. In this article, you'll learn how to setup the development environment of Ruby in Windows easily. It has an elegant syntax (similar to Python syntax) that is natural to read and easy to write. Ruby is a dynamic, open source programming language with a focus on simplicity and productivity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |