So I have code that runs just fine on ruby 1.8.7, but on 1.9.2 it doesn’t work.
Here’s the error message:
rake aborted!
/u/apps/proxy/releases/20111115125519/db/seeds.rb:16: syntax error, unexpected tASSOC, expecting ')'
:image_url => 'dooropen',
^
/u/apps/proxy/releases/20111115125519/db/seeds.rb:16: syntax error, unexpected ',', expecting $end
Here’s the relevant part of the code:
door_on_state = BoxStateConfiguration.create (
:image_url => 'dooropen',
:color => '#CD493B',
:label => 'Ytterdörr öppen',
:interactive => false
)
I added # encoding: utf-8 to the top of the file, since that’s sometimes the problem when it runs on 1.8.7, but not 1.9.2, but that didn’t change anything.
Does anyone know what ruby is complaining about?
Have you tried removing the space between
createand(? If Ruby doesn’t realize that you want to call a method, you can’t leave off the{}, since that’s reserved for handling a hash as last argument in a method.