I ran into a problem earlier today when testing a Merb application in a shared hosting environment running Phusion Passenger. Like most shared hosts access to compilers is not allowed for obvious security reasons, this causes a problem when trying to run a Merb app. Merb makes use of RubyInline which needs to compile a C application in your home folder before it can run so when the user you’re running Merb under doesn’t have permission to run C compilers you’ll get an error similar to:
The way to get around this is to have a privileged user compile the C application for you, then copy it to your users home folder. The easiest way to do this is to generate and run a Merb app as the root user:
1 2 3
Then copy the RubyInline C application to the users home folder:
Make sure the file ownership is set correctly:
After this you should be able to run Merb as expected. If you’re still getting errors relating to file permissions after following the instructions above you’ll need to combine the fix from Vignet and put the .ruby_inline folder in a place accessible to both the apache user and the user running the Merb app, I’ve not tested this but it should work.