Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Foreman gem没有从Procfile加载我的服务,它们总是失败_Ruby On Rails_Ruby_Ruby On Rails 3_Foreman - Fatal编程技术网

Ruby on rails Foreman gem没有从Procfile加载我的服务,它们总是失败

Ruby on rails Foreman gem没有从Procfile加载我的服务,它们总是失败,ruby-on-rails,ruby,ruby-on-rails-3,foreman,Ruby On Rails,Ruby,Ruby On Rails 3,Foreman,在我的本地开发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 thi

在我的本地开发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
我总是必须通过复制粘贴来手动启动所有这些设备。终端工头启动中的命令不起作用,我缺少什么

这是工头的输出:

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
16:13:24 redis.1 |以pid 11281开始
16:13:24回复1 |从pid 11282开始
16:13:24 privpub.1 |以pid 11283开始
16:13:24太阳黑子。1 |以pid 11284开始
16:13:24 redis.1 |[11281]04 Jun 16:13:24#警告:未使用默认配置指定配置文件。要指定配置文件,请使用“redis server/path/to/redis.conf”
16:13:24 redis.1 |[11281]04 Jun 16:13:24*服务器已启动,redis版本2.4.13
16:13:24 redis.1 |[11281]04 Jun 16:13:24*从磁盘加载的数据库:0秒
16:13:24 redis.1 |[11281]04 Jun 16:13:24*服务器现在准备接受端口6379上的连接
16:13:25 redis.1 |[11281]04 Jun 16:13:25-48个插槽中的DB 0:21键(0易失性)。
16:13:25 redis.1 |[11281]04 Jun 16:13:25-连接了0个客户端(0个从机),使用了955424字节
16:13:26 privpub.1 |/Users/jordan.rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.1/lib/rack/builder.rb:43:在“require”中:无法加载此类文件--/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'wrapp'
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`'
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`'
16:13:26 privpub.1 |进程终止
16:13:26系统|向所有进程发送SIGTERM
16:13:26系统|向pid 11281发送SIGTERM
16:13:26 redis.1 |[11281]04 Jun 16:13:26#收到SIGTERM,计划关机。。。
16:13:26 redis.1 12481]04 Jun 16:13:26#用户请求关闭。。。
16:13:26 redis.1 |[11281]04 Jun 16:13:26*退出前保存最终RDB快照。
16:13:26 redis.1 |[11281]04 Jun 16:13:26*磁盘上保存了DB
16:13:26 redis.1 |[11281]04 Jun 16:13:26 | redis现在准备退出,再见。。。
16:13:26系统|向pid 11282发送SIGTERM
16:13:26回复1 | rake中止!
16:13:26 resque.1 | SIGTERM
16:13:26回复1 |
16:13:26 resque.1 |(通过使用--trace运行任务查看完整跟踪)
16:13:26系统|向pid 11284发送SIGTERM
16:13:26太阳黑子。1 | rake中止!
16:13:26太阳黑子1 | SIGTERM
16:13:26太阳黑子1 |
16:13:26太阳黑子.1 |(通过使用--trace运行任务查看完整跟踪)
16:13:26太阳黑子。1 |过程终止
16:13:26回复1 |进程终止
16:13:26 redis.1 |进程终止

尝试删除输出重定向,方法是将第2行和第3行更改为:

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

Foreman可能在命令中有重定向问题:

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

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

Foreman在命令中可能会出现重定向问题:

Foreman start是否有任何输出?您是否使用了替代的Procfile,比如Procfile.dev?然后您应该像这样运行foreman:
foreman start-f Procfile.dev
。不,我只是将foreman start与常规Procfile一起使用。foreman start是否有任何输出?您是否使用了其他Procfile,比如Procfile.dev?然后您应该像这样运行foreman:
foreman start-f Procfile.dev
。不,我只是使用foreman start和常规Procfile