I tried to run an ruby script in rails with the command rails runner. The ruby file, looks something like this and should create new patients:
Patient.create!({:vorname => 'Josepha', :nachnahme => 'Brecht', :geburtsdatum => '25.04.1963', :strasse => 'Umdorf', :ort => 'Wörthss', :plz => '93093'})
Patient.create!({:vorname => 'Tumba', :nachnahme => 'Hoch', :geburtsdatum => '17.77.1956', :strasse => 'Hamaß 1', :ort => 'Brenn', :plz => '93189'})
But somehow my code has problems with the german language! Im programming beginner and do not know what i have to change! Thanks for help!
C:\Sites\what>rails runner patienten.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/c
ommands/runner.rb:51:in `eval': patienten.rb:2: invalid multibyte char (UTF-8) (
SyntaxError)
patienten.rb:2: syntax error, unexpected tIDENTIFIER, expecting '}'
...> 'Schlossberg', :ort => 'Wörth', :plz => '93086'})
... ^
patienten.rb:2: syntax error, unexpected tINTEGER, expecting $end
...:ort => 'Wörth', :plz => '93086'})
... ^
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/commands/runner.rb:51:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/commands.rb:64:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.1
3/lib/rails/commands.rb:64:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'