I’m trying to throw together a quick Sinatra app to call some test ruby scripts that need their own Bundler env to run.
Form a method in my Sinatra app I want to run something like
system("cd /test_app/; bundle exec ruby some_file.rb")
This doesn’t work due to the way that bundler sets up its environment. Is there a way to start a new shell session to execute my script so it works form Sinatra?
Or is there another way to do this? Basically my only requirement is that these scripts can be triggered from links on a webpage so some team members can fire off test processes.
Found this snippet which cleans the bundler env nicely. – http://johnbintz.github.com/blog/2012/02/02/the-cleanest-bundler-env/