gpt4 book ai didi

java - Sinatra Jruby Heroku - jruby : No such file or directory -- trinidad (LoadError)

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:14:30 26 4
gpt4 key购买 nike

我正在尝试运行此应用程序:github.com/Soliah/sinatra-jruby-heroku.git

根据 Heroku 的发布说明,需要进行一次更新:

http://devcenter.heroku.com/articles/release-note-java-2011-09-29

构建顺利,没有任何错误。下面是一些日志部分:

   [INFO] --- jruby-rake-plugin:1.6.3:jruby (install-bundler) @ jruby-heroku ---
[INFO] Successfully installed bundler-1.0.21
[INFO] 1 gem installed
[INFO]
[INFO] --- jruby-rake-plugin:1.6.3:jruby (bundle-install) @ jruby-heroku ---
[INFO] Fetching source index for http://rubygems.org/
[INFO] Installing jruby-rack (1.0.10)
[INFO] Installing rack (1.3.2)
[INFO] Installing tilt (1.3.3)
[INFO] Installing sinatra (1.2.6)
[INFO] Installing trinidad_jars (1.0.1)
[INFO] Installing trinidad (1.2.3)
[INFO] Using bundler (1.0.21)
[INFO] Your bundle is complete! It was installed into ./vendor/bundle

(...)

[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.408s
[INFO] Finished at: Tue Jan 31 10:58:03 UTC 2012
[INFO] Final Memory: 9M/490M
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> jruby, web
-----> Compiled slug size is 18.6MB
-----> Launching... done, v5
http://jrubyandjava.herokuapp.com deployed to Heroku

但是当我访问已部署的应用程序时。发生应用程序错误。

这是日志,有错误:

  $ heroku logs
2012-01-31T10:57:21+00:00 heroku[slugc]: Slug compilation started
2012-01-31T10:58:13+00:00 heroku[web.1]: State changed from created to starting
2012-01-31T10:58:19+00:00 heroku[web.1]: Starting process with command `sh script/jruby -S trinidad -p 52233`
2012-01-31T10:58:20+00:00 app[web.1]: Classpath is: :/app/etc:/app/target/dependency/jruby-complete.jar
2012-01-31T10:58:21+00:00 app[web.1]: jruby: No such file or directory -- trinidad (LoadError)
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from crashed to created
2012-01-31T10:58:23+00:00 heroku[web.1]: State changed from created to starting
2012-01-31T10:58:23+00:00 heroku[web.1]: Process exited
2012-01-31T10:58:28+00:00 heroku[web.1]: Starting process with command `sh script/jruby -S trinidad -p 26224`
2012-01-31T10:58:28+00:00 app[web.1]: Classpath is: :/app/etc:/app/target/dependency/jruby-complete.jar
2012-01-31T10:58:31+00:00 app[web.1]: jruby: No such file or directory -- trinidad (LoadError)
2012-01-31T10:58:32+00:00 heroku[web.1]: State changed from starting to crashed
2012-01-31T10:58:33+00:00 heroku[web.1]: Process exited
2012-01-31T10:58:33+00:00 heroku[router]: Error H10 (App crashed) -> GET jrubyandjava.herokuapp.com/ dyno= queue= wait= service= status=503 bytes=

JRuby 似乎没有发现 gem 。但是我已经尝试了各种配置(在 script/jruby、heroku config:add、Procfile 等中),但没有一个起作用。

还有一件事:这是实际的 heroku 配置输出(stack cedar)。

  $ heroku config
DATABASE_URL => postgres://kfgubrhars:mYBlJ2YKewqG7LwmPqVI@ec2-50-17-200-129.compute-1.amazonaws.com/kfgubrhars
JAVA_OPTS => -Xmx384m -Xss512k -XX:+UseCompressedOops
MAVEN_OPTS => -Xmx384m -Xss512k -XX:+UseCompressedOops
PATH => /usr/local/bin:/usr/bin:/bin
SHARED_DATABASE_URL => postgres://kfgubrhars:mYBlJ2YKewqG7LwmPqVI@ec2-50-17-200-129.compute-1.amazonaws.com/kfgubrhars

这是更新后的存储库:https://github.com/tomasmuller/sinatra-jruby-heroku

提前致谢!

最佳答案

好的!我找到了解决方案。以下是步骤:

  • 将 script/jruby 中的 GEM_HOME 调整为:

    GEM_HOME="$APPDIR"/vendor/bundle
  • 创建脚本/包,ENV['GEM_HOME'] 和 ENV['GEM_PATH'] 指向“vendor/bundle”目录。

  • 调整了 pom.xml 中 jruby-rake-plugin 的执行:

    install-bundler: <args>-S gem install bundler --no-ri --no-rdoc --install-dir vendor/bundle</args>

    bundle-install: <args>script/bundle install --without development:test</args>

关于java - Sinatra Jruby Heroku - jruby : No such file or directory -- trinidad (LoadError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9078871/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com