You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a file "file.txt", contents:
This is a test file.
I have a test script "test.rb", contents:
astr = ARGV[0]
File.open(astr,"r").each { |line| puts line }
If I type "ruby test.rb file.txt" I get:
This is a test file.
If I type "ocra test.rb" I get:
=== Loading script to check dependencies
C:/PATHTOSCRIPT/test.rb:2:in initialize': no implicit conversion of nil into String (TypeError) from C:/PATHTOSCRIPT/test.rb:2:inopen'
from C:/PATHTOSCRIPT/test.rb:2:in <top (required)>' from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.5/bin/ocra:1185:inload'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.5/bin/ocra:1185:in <top (required)>' from C:/Ruby22/bin/ocra:23:inload'
from C:/Ruby22/bin/ocra:23:in `
'
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
Here is my problem:
I have a file "file.txt", contents:
This is a test file.
I have a test script "test.rb", contents:
astr = ARGV[0]
File.open(astr,"r").each { |line| puts line }
If I type "ruby test.rb file.txt" I get:
This is a test file.
If I type "ocra test.rb" I get:
'=== Loading script to check dependencies
C:/PATHTOSCRIPT/test.rb:2:in
initialize': no implicit conversion of nil into String (TypeError) from C:/PATHTOSCRIPT/test.rb:2:in
open'from C:/PATHTOSCRIPT/test.rb:2:in
<top (required)>' from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.5/bin/ocra:1185:in
load'from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.5/bin/ocra:1185:in
<top (required)>' from C:/Ruby22/bin/ocra:23:in
load'from C:/Ruby22/bin/ocra:23:in `
What am I doing wrong?
The text was updated successfully, but these errors were encountered: