我已经使用 Elastic Beanstalk 在 EC2 上设置了一个应用程序。这是一个 Ubuntu 实例,我在其上运行一个依赖于 和 的 Rails 应用程序sphinxbase
。pocketsphinx
我已通过 ssh 进入 EC2 实例以安装 sphinxbase 及其依赖项:
sudo yum install autoconf libtool bison swig git
git clone https://github.com/cmusphinx/sphinxbase.git
cd sphinxbase/
./autogen.sh
./configure
make
make check
sudo make install
# Libraries have been installed in:
# /usr/local/lib64/python2.7/dist-packages/sphinxbase
重启后,我导航到我的应用程序的 URL,然后出现一个 Rails 错误页面,查看服务器日志:
Could not open library 'libsphinxbase.so': libsphinxbase.so: cannot open shared object file: No such file or directory (LoadError)
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/library.rb:133:in `block in ffi_lib'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `map'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `ffi_lib'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/sphinxbase.rb:5:in `<module:Sphinxbase>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/sphinxbase.rb:3:in `<module:API>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/sphinxbase.rb:2:in `<module:Pocketsphinx>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx/api/sphinxbase.rb:1:in `<top (required)>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx.rb:6:in `require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx.rb:6:in `<top (required)>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx-ruby.rb:1:in `require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/pocketsphinx-ruby-0.3.0/lib/pocketsphinx-ruby.rb:1:in `<top (required)>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:76:in `require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:72:in `each'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:72:in `block in require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:61:in `each'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler/runtime.rb:61:in `require'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.9.6/lib/bundler.rb:134:in `require'
/var/app/current/config/application.rb:7:in `<top (required)>'
/var/app/current/config/environment.rb:2:in `require'
/var/app/current/config/environment.rb:2:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/passenger-4.0.59/helper-scripts/rack-preloader.rb:112:in `eval'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/passenger-4.0.59/helper-scripts/rack-preloader.rb:112:in `preload_app'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/passenger-4.0.59/helper-scripts/rack-preloader.rb:158:in `<module:App>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/passenger-4.0.59/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/opt/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/passenger-4.0.59/helper-scripts/rack-preloader.rb:28:in `<main>'
所以找不到libsphinxbase.so
我现在不知道该做什么,而且还找不到相关信息。
有什么建议吗?谢谢。
答案1
一位同事向我推荐了这篇博客文章,它帮助我正确安装 cmu sphinx 及其依赖项。
http://jrmeyer.github.io/installation/2016/01/09/Installing-CMU-Sphinx-on-Ubuntu.html