Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.0.0RC2
-
Fix Version/s: JRuby 1.1RC2
-
Component/s: None
-
Labels:None
-
Environment:Windows XP, with and without NetBeans
-
Number of attachments :
Description
Running JRuby in NetBeans:
-------------------------
require 'rubygems'
require 'mailfactory'
mail = MailFactory.new()
mail.to = 'to address'
mail.from = 'from address'
mail.subject = 'subject'
mail.text = 'message'
puts mail.to_s
--returns nil
Running JIRB:
------------
jirb> require 'rubygems'
jirb> require 'mailfactory'
jirb> mail = MailFactory.new()
jirb> mail.to_s
NoMethodError: undefined or inaccessible method `euid' for
Process:Module
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:181:in `method_missing'
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:181:in `construct'
from
C:/jruby-1.0.0RC2/lib/ruby/gems/1.8/gems/mailfactory-1.2.3/lib/mail
factory.rb:211:in `to_s'
from (irb):1:in `binding'
irb(main):011:0>
Although reported on line 181, the error appears to stem
from line 182 of factory.rb:
add_header("Message-ID",
"<#{Time.now.to_f()}.#{Process.euid()}.#{String.new.object_id()}@#{sendingdomain}>")
^^^^^^^^^^^^^^
According to the API docs:
Process.euid => fixnum
Returns the effective user ID for this process.
Process.euid #=> 501
We could fix this with JNA in 1.1 and probably provide a similar bogus value to uid in 1.0.