Closed kernow closed 9 years ago
Since chruby-exec only modifies $PATH
/$GEM_HOME
/$GEM_PATH
, this sounds like a bug in how the mysql2 gem searches for libmysqlclient
. I would report upstream.
Also, you don't need a ruby switcher in production. It's much simpler to just install ruby via a package or into /usr/local
.
Thanks, I'll see what they say on the MySQL repo. This production server runs multiple rails apps requiring different Ruby versions hence using chruby.
I've been trying to install the mysql2 gem via bundler and have run into an issue when executing
chruby-exec 2.1.3 bundle install
. The result is a successful run of bundle install, however when attempting to use the mysql2 gem the following error is encountered:The gem can't find the libmysqlclient.so
However, when the exact same bundle command is run without using chruby-exec the mysql2 gem works correctly and can find the libmysqlclient.so
My setup is on a centos server with chruby installed via the root user, I'm then running the bundle command as the deployer user. As I'm deploying using capistrano if I don't use chruby-exec then the bundle command can't be found.