rubylinuxrvmbatch-processinglinux-from-scratch

How to use a certain ruby version?


I try to run a script on a LFS Batchsystem. The cluster offers an older version of ruby, so I had to install my gems and rvm locally on my account. Is there a way to run my local installed ruby version on a batch system? My script works fine on my account but not on LFS because mechanize depends on a newer ruby version.


Solution

  • I solved my problem with directly using the binary version and to define my local gem folder:

    GEM_HOME=/home/my_name/.rvm/gems/ruby-2.0.0-p195/gems
    /home/my_name/.rvm/bin/ruby-2.0.0-p195 my_script.rb
    

    The other solutions do not work, because rvm is not available on the cluster.