SyntaxError - odd number list for Hash

407 views
Skip to first unread message

Gustavo Schmid de Jesus

unread,
Dec 3, 2013, 9:42:25 AM12/3/13
to pon...@googlegroups.com
hello everyone,
im doing a plugin for redmine1.1.1 using rails 2.3.5 and ruby 1.8.7

im using pony to send emails with pdf reports but im not being able to send not even the simplest email ever.

Here is the code um using:
 Pony.mail(:to => 'exa...@example.com', :via => :smtp)

And here is the error: 
Processing ApplicationController#create_pdf (for 192.168.8.221 at 2013-12-03 12:29:56) [GET]
  Parameters: {project_id=>proj01-ti, action=>create_pdf, id=>16, controller=>ct_timeclock_report}

SyntaxError (/usr/lib/ruby/gems/1.8/gems/pony-1.6.1/lib/pony.rb:213: odd number list for Hash
          content: Base64.encode64(body),
                  ^
/usr/lib/ruby/gems/1.8/gems/pony-1.6.1/lib/pony.rb:213: syntax error, unexpected ':', expecting '}'
          content: Base64.encode64(body),
                  ^
/usr/lib/ruby/gems/1.8/gems/pony-1.6.1/lib/pony.rb:213: syntax error, unexpected ',', expecting kEND
/usr/lib/ruby/gems/1.8/gems/pony-1.6.1/lib/pony.rb:215: syntax error, unexpected '}', expecting kEND):
  vendor/plugins/redmine_ct/app/controllers/ct_timeclock_report_controller.rb:4

I`ve tried many more options like 

 Pony.options = {:to => usr.mail, :from => 'nor...@nscad.org.br', :via => :smtp, :via_options => {:address => 'smtp.nscad.org.br',:port => '25', :domain => 'localhost.localdomain'} }

and
 Pony.mail({:to => 'gus...@nscad.org.br', :attachments => {"pdfReport" => File.read("tmp/pdfs/" + pdfReport)} })
and
 Pony.mail(:to => 'gus...@nscad.org.br',:body => 'bla', :via => :smtp, :via_options => {:address => 'smtp.nscad.org.br',:port => '25',:username => '', :password => '',:domain => 'localhost.localdomain'} )

 and none of them worked, the errors were similar, like i was`nt specifying the correct variables for mail ...

anyone know why im getting this error ? can anyone give me a simple mail example that should work ? 

THANKS!

Ben Prew

unread,
Dec 5, 2013, 4:39:06 AM12/5/13
to pon...@googlegroups.com
Sorry, that syntax is ruby 1.9 only, I'll change it to be compatible with ruby 1.8.7


--
 
---
You received this message because you are subscribed to the Google Groups "Ponyrb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ponyrb+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ben Prew

unread,
Dec 5, 2013, 4:54:49 AM12/5/13
to pon...@googlegroups.com
Ok, pony 1.6.2 should use the ruby 1.8 hash syntax.

Thanks
Reply all
Reply to author
Forward
0 new messages