Call a shell script using a different ruby within a rails app -


i have rails application runs on ruby 1.9 , shell script (podcast producer) depends on ruby 1.8.

i need call shell script within application. ruby version manager use rvm , app runs within passenger. obvious reasons takes wrong ruby shell script (means, loads rvm , bundler env , tries start within same environment, application runs in).

first line of shell script:

#!/usr/bin/env ruby -i/usr/lib/podcastproducer 

call in app

`/usr/bin/podcast` 

how solve this?

you can use rvm-shell (included in rvm installation) override current ruby/rvm version in environment , explicitly use system's default ruby version (assuming have not installed alternate ruby version system default, can check running /usr/bin/ruby -v).

you should able use rvm-shell within ruby script follows:

`rvm-shell system -c '/usr/bin/podcast'` 

the system argument instructs rvm use system's default ruby version.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -