It appears that when putting Ruby code in an executable script, the index of a String behaves differently than it does in IRB or by running the Ruby code directly. For example:

```
$ cat > test
#!/usr/bin/ruby -w
puts 'hello'[0]
$ chmod +x test
$ ./test
104
$ ruby -e "puts 'hello'[0]"
h

```

Why is this? And, how do I make the executable script behave the same as "normal" Ruby code?