2 Replies - 706 Views - Last Post: 30 August 2013 - 06:19 PM Rate Topic: -----

#1 heaphyg  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 85
  • Joined: 30-August 13

syntax error when dragging text edit script into terminal

Posted 30 August 2013 - 11:17 AM

I am brand new to coding. I was successfully dragging in functional text edit scripts into terminal previously , however, I am currently receiving a syntax error when I attempt to drag in a script into terminal. The script contains puts "enter your name". The error is as follows:

[>> ruby /Users/gregoryheaphyheaphy/Desktop/cow.rb
SyntaxError: compile error
(irb):2: unknown regexp options - grgryhaphyhaphy
from (irb):2]

I have visited forums and have attempted many time to get through to somone on the free Ruby hotline.

Thanks,
Greg

Is This A Good Question/Topic? 0
  • +

Replies To: syntax error when dragging text edit script into terminal

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2113
  • View blog
  • Posts: 3,233
  • Joined: 21-June 11

Re: syntax error when dragging text edit script into terminal

Posted 30 August 2013 - 11:25 AM

Apparently you're currently in IRB, not your shell. Exit IRB or open a new terminal (running your shell) and then enter the command into that one and it will work fine.

IRB is where you enter Ruby code and it will execute it and show you its return value. ruby /Users/gregoryheaphyheaphy/Desktop/cow.rb is not Ruby code - it's a shell command.
Was This Post Helpful? 1
  • +
  • -

#3 heaphyg  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 85
  • Joined: 30-August 13

Re: syntax error when dragging text edit script into terminal

Posted 30 August 2013 - 06:19 PM

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Thank you very much. I would never have figured that out.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1