I have a Rails application that runs on Ruby 1.9 and a shell script (Podcast Producer) that depends on Ruby 1.8.
I need to call the shell script from within the application. The Ruby Version Manager I use is rvm and the app runs within passenger. Now for obvious reasons it takes the wrong Ruby for the shell script (means, it loads rvm and bundler env and tries to start it within the same Environment, as the application runs in).
First line of the shell script:
#!/usr/bin/env ruby -I/usr/lib/podcastproducer
Call in the app
`/usr/bin/podcast`
How would you solve this?