Reputation: 16627
I need to start a sinatra app from within a Rails task. Unfortunately whenever I call system("shotgun")
or system("rackup")
I get weird conflicting errors. When I start them normally from within bash then everything runs fine.
The errors reach from shotgun is not part of the bundle
to uninitialized constant ActionController::Base (NameError)
.
Any suggestions how I could start other rack apps from within a Rails app?
Upvotes: 1
Views: 922
Reputation: 16627
Solution ... the trick is to unset some shell variables:
unset BUNDLE_GEMFILE
unset RUBYOPT
unset BUNDLE_BIN_PATH
Upvotes: 1
Reputation: 33954
Hard to say, but since it runs from within bash, it sounds like there is a difference between the environment in which the rake task is run, and your bash environment.
Basically, figure out what in your bash environment is required in order to make things work, and replicate that in the environment in which your rake task runs.
Upvotes: 0