【发布时间】:2014-08-14 03:55:41
【问题描述】:
我在屏幕上使用 tts gemfor 语音音频,在本地开发站上一切正常,但在 heroku 的服务器上抛出 500。 tts gem 依赖于mpg123。
heroku 日志在运行时发回以下错误:
2014-06-23T09:37:47.024478+00:00 app[web.1]: mpg123 executable NOT found. This function only work with POSIX systems.
2014-06-23T09:37:47.024485+00:00 app[web.1]: Install mpg123 with `brew install mpg123` or `apt-get install mpg123`
2014-06-23T09:37:47.025829+00:00 app[web.1]: Completed 500 Internal Server Error in 196ms
第一次尝试: heroku 运行 brew install mpg123
Running `brew install mpg123` attached to terminal... up, run.1741
bash: brew: command not found
第二次尝试: heroku 运行 apt-get install mpg123
Running `apt-get install mpg123` attached to terminal... up, run.5879
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Unable to write to /var/cache/apt/
E: The package lists or status file could not be parsed or opened.
经过进一步研究,我现在了解到“custom buildpack”需要实施?如果是这样,如何确定要使用哪个 buildpack 以及如何使用它安装 mpg123?除非有更简单或更合适的方法,否则我当然也愿意接受。
从this post 收集到一些线索,我通过添加以下 buildbacks 在黑暗中进行了一些尝试,然后重新运行上述尝试,但无济于事:
heroku plugins:install https://github.com/heroku/heroku-buildpacks
Installing heroku-buildpacks... done
heroku config:add BUILDPACK_URL=https://github.com/benjie/heroku-buildpack-apt
heroku config:add BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby
heroku config:add BUILDPACK_URL=https://github.com/atris/heroku-buildpack-C
不管怎样,这是一个在 heroku 的 cedar 堆栈下运行的 rails 4 项目。
谢谢!
【问题讨论】:
标签: heroku ruby-on-rails-4 heroku-toolbelt