【问题标题】:"foreman start" results in "Could not find bundler (>= 0) amongst..." error“工头开始”导致“在...中找不到捆绑程序(> = 0)”错误
【发布时间】:2012-08-24 22:09:50
【问题描述】:

我从 heroku 的文档中复制了一个示例 Procfile,并尝试使用 foreman 在本地运行 Sinatra 应用程序。

每当我尝试foreman start 时,我都会得到:

~/Repos/website ➜ foreman start
14:04:43 web.1  | started with pid 2916
14:04:44 web.1  | /usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [bigdecimal-1.1.0, daemons-1.1.9, eventmachine-0.12.10, io-console-0.3, json-1.5.4, minitest-2.5.1, rack-1.4.1, rack-protection-1.2.0, rake-0.9.2.2, rdoc-3.9.4, rubygems-update-1.8.24, sinatra-1.3.3, thin-1.4.1, tilt-1.3.3, yard-0.8.2.1] (Gem::LoadError)
14:04:44 web.1  |   from /usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
14:04:44 web.1  |   from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
14:04:44 web.1  |   from /home/nicolas/.gem/ruby/1.9.1/bin/bundle:22:in `<main>'
14:04:44 web.1  | exited with code 1
14:04:44 system | sending SIGTERM to all processes
SIGTERM received

这些是我的 Procfile 的内容:

web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT

我在有和没有 rbenv 的情况下都试过了。我目前通过 Arch 的包管理器 pacman 安装了 Ruby。我也安装了捆绑器。我已经尝试过列出herehere 的答案。任何帮助将不胜感激。

【问题讨论】:

  • 您是否尝试将工头添加到您的 Gemfile 并使用“bundle exec foreman start”启动它?
  • 好主意,我以前没有这样做。我现在添加了它,但我收到了这个错误:gist.github.com/f2db5ec84d29043be4b1。我尝试了 Heroku 开发中心的另一个建议,并将我的 Procfile 替换为 web: bundle exec rackup config.ru -p $PORT,但由于某种原因,工头现在只是告诉我我的 PID 并冻结。 :\ 奇怪的是,当我按下 ctrl-c 时,我看到了一些简短的瘦输出(瘦启动)。似乎这可能是标准输出被路由的问题。

标签: ruby sinatra rack rbenv foreman


【解决方案1】:

在等待一段时间、更新 gems 并再次尝试后,当 Procfile 包含以下内容时,我现在可以正常工作了:

web: bundle exec rackup

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-03
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 2017-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多