Home > Software engineering >  I can't run my Ruby program and I see errors in the terminal. I can't find the program
I can't run my Ruby program and I see errors in the terminal. I can't find the program

Time:08-14

Good afternoon! I have a problem with Ruby. I downloaded this program from the official site https://www.ruby-lang.org/en/downloads/ on Fedora without any problems (using the command via the terminal). However, I cannot use the 'irb' command in the terminal to run Ruby on Linux as described here https://www.ruby-lang.org/en/documentation/quickstart/. Therefore, I cannot learn the Ruby programming language.Command 'irb' not found

I tried my best to run Ruby in other ways. One of them, as is customary in Fedora, is to write the name of the program in the terminal. But it opens a folder in which, I assume, Ruby is located (I can't find the folder itself either in Files or via the 'cd' command in the terminal). I kind of can open this folder in the terminal, but I can't find it in Files. Oh, by the way, the 'irb' command doesn't work there. Only some real command for a program like this one will work: irb(main):001:0> "Hello World" (from https://www.ruby-lang.org/en/documentation/quickstart/). The program is and is not at the same time

Move on. I made a text document, wrote irb(main):001:0> "Hello World" in it (as written in "Ruby in Twenty Minutes"), and saved the file as hello.rb . Opened the hello.rb file path through the terminal and wrote 'ruby hello.rb' (without quotes, of course). Result: syntax error. hello.rb file Tried to open hello.rb via ruby in terminal

Oh yeah, I almost forgot: when I tried to open hello.rb in Files through another application, there was no Ruby script in the list (ruby or irb or at least something through which one could open a .rb file). No program for .rb format

I hope I have explained the problem in sufficient detail and clearly. And I hope for your help and understanding! In any case, good mood to you!

CodePudding user response:

On Fedora & CentOS, the Ruby installation is split into many smaller packages. If you want to run irb, you'll also have to install the ruby-irb package using dnf install ruby-irb.

  •  Tags:  
  • ruby
  • Related