Ruby no such file to load

map7

New Member

Reaction score: 1
Messages: 5

I'm trying to use the mailfactory gem under FreeBSD and have a feeling that this is more a Permissions problem under FreeBSD than it is a ruby problem.

Here is the test code I'm using
Code:
#!/usr/bin/env ruby

require 'net/smtp'
require 'rubygems'
require 'mailfactory'

mail = MailFactory.new()
mail.to = "<my email>"
mail.from = "<my email>"
mail.subject = "Test subject"
mail.text = "Test body"
mail.attach("/etc/fstab")

Net::SMTP.start('mail.lan', 25) { |smtp|
  mail.to = toaddress
  smtp.send_message(mail.to_s(), mail.from, mail.to)
}
If I run my test code as a normal user (ie: not in the wheel group) I get:
Code:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- mailfactory (LoadError)
  from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  from ./testmailfactory.rb:5
If I run it as a wheel user then there is no problem and the email goes through to my email account fine.
 
OP
OP
map7

map7

New Member

Reaction score: 1
Messages: 5

SOLVED.

Had to change permissions from 774 to 775 on the following directories
/usr/local/lib/ruby/gems
/usr/local/lib/ruby/gems/1.8
/usr/local/lib/ruby/gems/1.8/*
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 2,788
Messages: 11,279

755 should be quite enough.
 
Top