From raasdnil at gmail.com Mon May 4 07:21:22 2009 From: raasdnil at gmail.com (Mikel Lindsaar) Date: Mon, 4 May 2009 21:21:22 +1000 Subject: [Tmail-talk] Cannot gem install tmail with jruby In-Reply-To: <938d08060905032347k6133bcfeve9dde2714beacee0@mail.gmail.com> References: <200904302138.03505.M8R-f9xidb@mailinator.com> <938d08060905032347k6133bcfeve9dde2714beacee0@mail.gmail.com> Message-ID: <57a815bf0905040421x5a6ef26cq4af300933939fe0d@mail.gmail.com> On Mon, May 4, 2009 at 4:47 PM, Amitabh Jain wrote: > On Fri, May 1, 2009 at 1:08 AM, Marc Cooper >> How do I force a pure ruby install in this case? I am not sure if tmail will automagically fail over without C extensions, but if you don't have the c extensions installed, it _should_ just run in ruby fine by itself. If you extract the tmail tar ball and get the lib/ directory with tmail.rb in it and require that you should be fine. Just nuke the ext directory from memory. Mikel From byrnejb at harte-lyne.ca Mon May 4 17:39:07 2009 From: byrnejb at harte-lyne.ca (James B. Byrne) Date: Mon, 4 May 2009 17:39:07 -0400 (EDT) Subject: [Tmail-talk] Reading From a UnixMbox file. Message-ID: <38071.216.185.71.24.1241473147.squirrel@webmail.harte-lyne.ca> I am trying to test a script that generates email using uses Rails ActionMailer 2.3.2. I have installed the TMail 1.2.3.1 gem. The way that this works is this. In the script I dump the contents of ActionMailer::Base.deliveries into a disk file: ActionMailer::Base.deliveries.each do |msg| fo = File.open('deliver.txt','a') fo.write(msg) fo.write("\n") fo.close end To the best of my ability to determine, this creates a valid mbox format file. I might be wrong but according to what I have read, the mbox format simply requires a blank line after each message. A message is deemed to begin with the 'From: ' header. The contents of this disk file appear correct given the foregoing expectation: $ cat deliver.txt From: Forex at harte-lyne.ca Reply-To: support at harte-lyne.ca To: forex.test at harte-lyne.ca Subject: [ForEx] 2009-05-04 - Foreign Exchange Rates Notice Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=mimepart_49ff56b0689be_25e01588753607c83ab --mimepart_49ff56b0689be_25e01588753607c83ab Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: Quoted-printable Content-Disposition: inline ... --mimepart_49ff56b0689be_25e01588753607c83ab-- --- end of file here - not part of actual file I gather from the documentation that I should be able to read this message back into a TMail::Mail object doing this: >> mbox = TMail::UNIXMbox.new('deliver.txt', nil, true) => #, @readonly=true, @real=#, @closed=false, @filename="deliver.txt"> >> mbox.each do |port| ?> mail = TMAIL::Mail.new(port) >> puts mail.subject >> y mail.methods.sort >> end => Mon May 04 17:11:07 -0400 2009 What I get is a time object and I see no mail message. If I try this instead, taken from the example given in the documentation: >> mailbox = TMail::UNIXMbox.new('deliver.txt', nil, true) => #, @readonly=true, @real=#, @closed=false, @filename="deliver.txt"> >> @emails = [] => [] >> @emails = mailbox.each_port { |m| @emails << TMail::Mail.new(m) } => Mon May 04 17:36:07 -0400 2009 >> @emails.class => Time Another time object is returned. What is going on here. What am I doing wrong? -- *** E-Mail is NOT a SECURE channel *** James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3 From tmail at auxbuss.com Tue May 12 07:58:05 2009 From: tmail at auxbuss.com (Marc Cooper) Date: Tue, 12 May 2009 13:58:05 +0200 Subject: [Tmail-talk] Cannot gem install tmail with jruby Message-ID: <200905121358.05749.tmail@auxbuss.com> Sorry for the repeat, but I lost the replies. Also, only one reply appears in the archives, which is odd, as I received three. Anyway, I asked: I'm trying to install the native ruby tmail gem. http://tmail.rubyforge.org/ doesn't describe how to do this, that I could find, although it does say that this should work when a C compiler is not present. Here's[1] the result of $ jruby -S gem install tmail How do I force a pure ruby install in this case? Btw, I also tried this on a Windows machine without a C compiler and it failed in exactly the same way. [1] Building native extensions. This could take a while... /home/marc/jruby/lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (NotImplementedError) from /home/marc/jruby/lib/ruby/1.8/mkmf.rb:1:in `require' from extconf.rb:1 ERROR: Error installing tmail: ERROR: Failed to build gem native extension. /home/marc/jruby/bin/jruby extconf.rb ========================= I received the reply: On Mon, May 4, 2009 at 4:47 PM, Amitabh Jain wrote: > On Fri, May 1, 2009 at 1:08 AM, Marc Cooper >> How do I force a pure ruby install in this case? I am not sure if tmail will automagically fail over without C extensions, but if you don't have the c extensions installed, it _should_ just run in ruby fine by itself. If you extract the tmail tar ball and get the lib/ directory with tmail.rb in it and require that you should be fine. Just nuke the ext directory from memory. Mikel ========================= I'm trying to install a gem that requires tmail. To satisfy that requirement I need tmail installed. Because of the native extension, I can't install tmail for JRuby. Installing locally isn't an option here, as I want to create a gem that will run under JRuby. The problem being that anyone installing my gem will have the same issue. If the pure ruby gem install is not going to be fixed, which is what I presume from the lack of activity to fix it, which is fair enough, are there any objections to me forking tmail to provide a pure ruby install? -- Best, Marc