我正在尝试使用厨师社区食谱opsworks_ruby来部署rails应用程序。我目前遇到了一个问题,tiny_tds版本0.9.5.beta.10。
尝试使用以下命令迁移数据库时:
/usr/local/bin/bundle exec rake db:migrate
我收到此错误:
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'
然而,当我ssh到服务器和
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
我将此作为回复:
[...]tiny_tds.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=cce05b6143516778339554cb7b1e2db232bb155e, not stripped
所以文件显然在那里,为什么不能找到它?
我目前安装了ruby 2.2.4。
致电
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
给我这个:
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)
另外,研究路径和诸如此类的东西:
$ 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]
我注意到我没有GEM_HOME或GEM_PATH,但我的红宝石看起来不错?
有人可以帮我解决这个问题吗?