No such file to load -- rubygems (LoadError)

C

Chih tung Chao

Hi all

I have use ruby to write a shell script to send email automatic, then i
use "#ruby auto_send_mail_for_hk.rb" command to test it and all is
correct, but i got following error when i set it to crontab tast for
automatic run

Please help me, thanks


/root/scripts/auto_send_mail_for_hk.rb:7:in `require': No such file to
load -- rubygems (LoadError)
from /root/scripts/auto_send_mail_for_hk.rb:7
 
R

Ryan Davis

Hi all
=20
I have use ruby to write a shell script to send email automatic, then = i
use "#ruby auto_send_mail_for_hk.rb" command to test it and all is
correct, but i got following error when i set it to crontab tast for
automatic run
=20
Please help me, thanks
=20
=20
/root/scripts/auto_send_mail_for_hk.rb:7:in `require': No such file to
load -- rubygems (LoadError)
from /root/scripts/auto_send_mail_for_hk.rb:7

env | grep RUBY

you're probably activating rubygems via your environment. Your script =
should have:

require "rubygems"

before requiring your email gem.
 
C

Chih tung Chao

Ryan Davis wrote in post #968509:
env | grep RUBY

you're probably activating rubygems via your environment. Your script
should have:

require "rubygems"

before requiring your email gem.


My script already have require "rubygems", and how to set rubygems
environment in my system ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top