I am trying to use the chef community cookbook opsworks_ruby to deploy a rails app. I am currently running into an issue with one of my gems, tiny_tds version 0.9.5.beta.10.
When trying to migrate the database with the following command:
/usr/local/bin/bundle exec rake db:migrate
I am getting this error:
STDERR: rake aborted!
LoadError: libruby.so.2.1: cannot open shared object file: No such file or directory - /srv/www/api/shared/vendor/bundle/ruby/2.2/extensions/x86_64-linux/2.2/tiny_tds-0.9.5.beta.10/tiny_tds/tiny_tds.so
/srv/www/api/shared/vendor/bundle/ruby/2.2/gems/tiny_tds-0.9.5.beta.10/lib/tiny_tds.rb:36:in `require'
/srv/www/api/shared/vendor/bundle/ruby/2.2/gems/tiny_tds-0.9.5.beta.10/lib/tiny_tds.rb:36:in `<top (required)>'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
/usr/local/share/ruby/gems/2.2/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
However when I ssh into the server and
file /srv/www/api/shared/vendor/bundle/ruby/2.2/extensions/x86_64-linux/2.2/tiny_tds-0.9.5.beta.10/tiny_tds/tiny_tds.so
I get this as a response:
[...]tiny_tds.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=cce05b6143516778339554cb7b1e2db232bb155e, not stripped
So the file is clearly there, why can't it be found?
I currently have ruby 2.2.4 installed.
Calling
ldd /srv/www/api/shared/vendor/bundle/ruby/2.2/extensions/x86_64-linux/2.2/tiny_tds-0.9.5.beta.10/tiny_tds/tiny_tds.so
Gives me this:
linux-vdso.so.1 => (0x00007ffe73dcf000)
libruby.so.2.1 => not found
libct.so.4 => not found
libsybdb.so.5 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fee58fe0000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fee58ddb000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fee58ba4000)
libm.so.6 => /lib64/libm.so.6 (0x00007fee588a2000)
libc.so.6 => /lib64/libc.so.6 (0x00007fee584df000)
/lib64/ld-linux-x86-64.so.2 (0x0000556740bd7000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007fee582dd000)
Also, looking into paths and whatnot:
$ echo $PATH
> /usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin
$ echo $GEM_HOME
>
$ echo $GEM_PATH
>
$ which ruby
> /usr/bin/ruby
$ /usr/bin/ruby -v
> ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux-gnu]
I notice I have no GEM_HOME or GEM_PATH, but my ruby looks correct?
Can anyone help me resolve this issue?