Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    saving and running ruby scripts

    When i save my script as name.rb using kate and then go to the konsole term and type in ruby name.rb the script wont run. I had unix for a short period of time before installing linux and it worked perfectly. I cant figure this one out i got ruby installed i got the text editor i write the script and save it as name.rb. Yet when i go to the konsole and type in ruby name.rb it says file not found. Anyone know how to fix this? i have suse pro 9.0 if it helps.

  2. #2
    At the top of the script make sure you have the shebang correct:


    or just use

    ruby prog.rb


    I tend to use perl and python myself... I can never find a machine with ruby installed... including my own.


  3. #3
    ruby prog.rb is what i was doing and it wasnt working( was telling me could not find file). The shebang i couldnt figure out how to change it(on unix it was automated i guess so i never bothered). So assuming changing the shebang is the answer how would i change it to what you typed.

  4. $spacer_open
  5. #4
    i logged in as the root user and ruby scripts ran perfectly. I dont know exactly why it works on root and not on the other user but all my problems are solved even if i figured out the answer by accident heh.

  6. #5
    Sounds like a permission problem. To allow others to execute it

    chmod 0644 name.rb

    ruby name.rb


    chmod 0755 name.rb



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts