regex - Opening a file in Ruby - unknown regexp options - Prgra ERROR? -


i trying open file , store contents useable input methods in separate file. specifically, have 1 file "test_int_file.rb", has 1 integer on each line. use each integer input method.

i have attempted open file using command in same file methods stored: file.open("/desktop/programs/test_int_file.rb")

my plan use following each line separate integer input (stored in array) can pass method:

file_arr = [] file.open("/desktop/programs/test_int_file.rb").each_line |line| file_arr << line.to_i end 

so 2 main questions here:

1) when attempt file.open("/desktop/programs/test_int_file.rb") on mac, error in terminal: unknown regexp options - prgra doing wrong in opening file?

2) block of code above work input file of integers array of integers?

thanks in advance!


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -