1

在我的本地开发 OSX 上使用 Foreman GEM 我无法正确启动我的所有服务。我遇到了问题,所以我在每次重新启动时手动复制并粘贴 Procfile 中的行。非常令人沮丧

这是我的 Procfile.rb:

redis: redis-server
resque: bundle exec rake resque:start  &&> log/resque_worker_queue.log
privpub: bundle exec rackup private_pub.ru -s thin -E production & &> log/private_pub.log
sunspot: bundle exec rake sunspot:solr:run

我总是必须通过复制粘贴终端工头启动中的命令来手动启动所有这些命令不起作用,我错过了什么?

这是工头输出:

    16:13:24 redis.1    | started with pid 11281
16:13:24 resque.1   | started with pid 11282
16:13:24 privpub.1  | started with pid 11283
16:13:24 sunspot.1  | started with pid 11284
16:13:24 redis.1    | [11281] 04 Jun 16:13:24 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
16:13:24 redis.1    | [11281] 04 Jun 16:13:24 * Server started, Redis version 2.4.13
16:13:24 redis.1    | [11281] 04 Jun 16:13:24 * DB loaded from disk: 0 seconds
16:13:24 redis.1    | [11281] 04 Jun 16:13:24 * The server is now ready to accept connections on port 6379
16:13:25 redis.1    | [11281] 04 Jun 16:13:25 - DB 0: 21 keys (0 volatile) in 48 slots HT.
16:13:25 redis.1    | [11281] 04 Jun 16:13:25 - 0 clients connected (0 slaves), 955424 bytes in use
16:13:26 privpub.1  | /Users/jordan.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:43:in `require': cannot load such file -- /Users/jordan/rails/books/log/private_pub.log (LoadError)
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:43:in `parse_file'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/server.rb:137:in `start'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/bin/rackup:19:in `load'
16:13:26 privpub.1  |   from /Users/jordan/.rvm/gems/ruby-1.9.3-p194/bin/rackup:19:in `<main>'
16:13:26 privpub.1  | process terminated
16:13:26 system     | sending SIGTERM to all processes
16:13:26 system     | sending SIGTERM to pid 11281
16:13:26 redis.1    | [11281] 04 Jun 16:13:26 # Received SIGTERM, scheduling shutdown...
16:13:26 redis.1    | [11281] 04 Jun 16:13:26 # User requested shutdown...
16:13:26 redis.1    | [11281] 04 Jun 16:13:26 * Saving the final RDB snapshot before exiting.
16:13:26 redis.1    | [11281] 04 Jun 16:13:26 * DB saved on disk
16:13:26 redis.1    | [11281] 04 Jun 16:13:26 # Redis is now ready to exit, bye bye...
16:13:26 system     | sending SIGTERM to pid 11282
16:13:26 resque.1   | rake aborted!
16:13:26 resque.1   | SIGTERM
16:13:26 resque.1   | 
16:13:26 resque.1   | (See full trace by running task with --trace)
16:13:26 system     | sending SIGTERM to pid 11284
16:13:26 sunspot.1  | rake aborted!
16:13:26 sunspot.1  | SIGTERM
16:13:26 sunspot.1  | 
16:13:26 sunspot.1  | (See full trace by running task with --trace)
16:13:26 sunspot.1  | process terminated
16:13:26 resque.1   | process terminated
16:13:26 redis.1    | process terminated
4

1 回答 1

1

尝试通过将第 2 行和第 3 行更改为:

resque: bundle exec rake resque:start
privpub: bundle exec rackup private_pub.ru -s thin -E production

Foreman 可能在命令中遇到重定向问题:https ://github.com/ddollar/foreman/issues/search?q=redirect

于 2012-06-05T21:56:44.947 回答