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

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top