Ruby 1.9 で次のエラーを再現する方法を知りたいです。
NoMethodError (undefined method `[]' for nil:NilClass):
それは私自身の興味です。以下は私にとってはうまくいきません:
a = nil
a[:key]
次のエラーが発生します。
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]