You can only read in strings from a file, and you can only write out 
strings to a file.

If you read in the string ":symbol_1", you have to convert that to a 
symbol.  If the file is from a trusted source, you could simply eval the 
string:

str = ":symbol_1"
str = eval str
p str

--output:--
:symbol_1

Otherwise, you can can remove the leading colon and then convert the 
string to a symbol with to_sym():

str = ":symbol_1"
sym = str[1..-1].to_sym
p sym

--output:--
:symbol_1

To convert a symbol to a string and add a leading colon, so that you can 
write the string to a file, you can do this:

sym = :symbol_1
p ":#{sym.to_s}"

--output:--
":symbol_1"

-- 
Posted via http://www.ruby-forum.com/.