You should take this up on a ruby list, this list is for rubygems developers.
But I'll throw you a bone.
You're trying to run ruby in your shell. Run "irb" first then type in your ruby
code.
- Evan
On Mar 19, 2011, at 10:47 AM, beegee beegee wrote:
> Hi All,
> I have a mac os x tiger 10.4.11, and ruby i.8.6. I was trying to open a
> file using the following command
>
> $ File.open('new-inventory.txt')
> -bash: syntax error near unexpected token `'new-inventory.txt''
>
> Then I tried double quotes
>
> $ File.open("new-inventory.txt")
> -bash: syntax error near unexpected token `"new-inventory.txt"'
>
> I also tried
>
> File.open("new-inventory.txt", "r")
> -bash: syntax error near unexpected token `"new-inventory.txt",'
>
> *My question is, how do I open this file (new-inventory.txt) and how do i
> read from it?*
>
> *Regards*
> *
> *
> _______________________________________________
> Rubygems-developers mailing list
> http://rubyforge.org/projects/rubygems
> [email protected]
> http://rubyforge.org/mailman/listinfo/rubygems-developers
>
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
[email protected]
http://rubyforge.org/mailman/listinfo/rubygems-developers