views:

23

answers:

1

I have created one shell script in my lib folder.

And i want to use RAILS_ROOT in that script instead of the long path.

Is there any way i can do this?

This my script

if ! [ -s delayed_job.pids ]; then
  RAILS_ENV=production /home/app/script/delayed_job start
fi

I want to modified this line with something like that.

if ! [ -s delayed_job.pids ]; then
  RAILS_ENV=production #{RAILS_ROOT}/script/delayed_job start
fi

Is it possible? How ?

+1  A: 
run_result = `#{Rails.root}/lib/your_script_name.sh` 
# ` is backtick character in upper left corner of your keyboard below ESC
clyfe