Two comments. One, ruby changes its meaning of String#[x] across versions (sigh), so it is preferred to use String#[x,1] instead.

Additionally, prefer to avoid indenting when you can
```
next if line[0,1] == "#"
line = line.strip.split
...
```

This also fixes maybe-bug that if the line is commented as "#something" then line[0] as you have above will be "#something" and this comment won't be ignored. 
```