使用heroku-buildpack-multi启动Rails

时间:2013-11-18 03:36:10

标签: ruby-on-rails heroku

我正在尝试使用subject software作为在Heroku上加载tesseract的一部分,但是Rails没有启动。我已经取出了非ruby的东西,以便.buildpacks文件中包含以下行:

https://github.com/heroku/heroku-buildpack-ruby

但Rails仍然无法自动启动。我必须执行heroku ps:scale web=1才能让事情顺利进行。知道如何让Rails在这种情况下自动启动吗?

更新:将以下行添加到我的.buildpacks并再次推送:

https://github.com/marcolinux/heroku-buildpack-libraries

文件.buildpacks_bin_download包含:

tesseract-ocr https://s3.amazonaws.com/tesseract-ocr/heroku/tesseract-ocr-3.02.02.tar.gz 3.02 eng,spa

Rails服务器不再运行。当我做heroku ps时,没有任何表现。当我heroku ps:scale web=1时,我得到以下内容:

Scaling web dynos... failed
 !    Resource not found

这是日志文件的尾部。请注意,在此过程中我做了heroku run bash几次:

2013-11-18T04:04:38.184151+00:00 heroku[api]: Starting process with command `bash` by palfvin@gmail.com
2013-11-18T04:04:43.267609+00:00 heroku[run.5246]: Awaiting client
2013-11-18T04:04:43.330445+00:00 heroku[run.5246]: Starting process with command `bash`
2013-11-18T04:04:43.385663+00:00 heroku[run.5246]: State changed from starting to up
2013-11-18T04:05:05.124216+00:00 heroku[run.5246]: Process exited with status 0
2013-11-18T04:05:05.142063+00:00 heroku[run.5246]: State changed from up to complete
2013-11-18T04:09:54+00:00 heroku[slug-compiler]: Slug compilation started
2013-11-18T04:10:30.590354+00:00 heroku[api]: Deploy 9dc41c1 by palfvin@gmail.com
2013-11-18T04:10:30.627601+00:00 heroku[api]: Release v24 created by palfvin@gmail.com
2013-11-18T04:10:30+00:00 heroku[slug-compiler]: Slug compilation finished
2013-11-18T04:12:29.331142+00:00 heroku[api]: Starting process with command `bash` by palfvin@gmail.com
2013-11-18T04:12:36.325595+00:00 heroku[run.9509]: Awaiting client
2013-11-18T04:12:36.371452+00:00 heroku[run.9509]: State changed from starting to up
2013-11-18T04:12:36.385073+00:00 heroku[run.9509]: Starting process with command `bash`
2013-11-18T04:12:46.408695+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/favicon.ico host=avlats.herokuapp.com fwd="71.189.7.153" dyno= connect= service= status=503 bytes=
2013-11-18T04:12:45.889685+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path=/ host=avlats.herokuapp.com fwd="71.189.7.153" dyno= connect= service= status=503 bytes=
2013-11-18T04:13:23.728990+00:00 heroku[run.9509]: State changed from up to complete
2013-11-18T04:13:23.714522+00:00 heroku[run.9509]: Process exited with status 127
2013-11-18T04:33:20.414300+00:00 heroku[api]: Starting process with command `bash` by palfvin@gmail.com
2013-11-18T04:33:27.248649+00:00 heroku[run.8551]: State changed from starting to up
2013-11-18T04:33:27.326433+00:00 heroku[run.8551]: Awaiting client
2013-11-18T04:33:27.387998+00:00 heroku[run.8551]: Starting process with command `bash`
2013-11-18T04:35:43.706884+00:00 heroku[run.8551]: Process exited with status 0
2013-11-18T04:35:43.719152+00:00 heroku[run.8551]: State changed from up to complete

以下是更改git push heroku中的订单后.buildpacks的输出,以便红宝石线排在第二位:

Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 293 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/marcolinux/heroku-buildpack-libraries
=====> Detected Framework: detect
Adding library tesseract-ocr
Downloading Binaries
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9224k  100 9224k    0     0  2313k      0  0:00:03  0:00:03 --:--:-- 2326k
Building runtime environment for tesseract-ocr
customizing tesseract-ocr
3.02
/tmp/build_f35a94fc-d088-4c7a-8731-65e170fb67ae/vendor/
Getting tesseract-ocr training data
English training data
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.0M  100 12.0M    0     0  3277k      0  0:00:03  0:00:03 --:--:-- 3369k
eng training data
https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.0M  100 12.0M    0     0  11.4M      0  0:00:01  0:00:01 --:--:-- 12.0M
spa training data
https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.spa.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 9613k  100 9613k    0     0  8781k      0  0:00:01  0:00:01 --:--:-- 9243k
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-ruby
=====> Detected Framework: Ruby
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Using rake (10.1.0)
       Using Ascii85 (1.0.2)
       Using i18n (0.6.5)
       Using minitest (4.7.5)
       Using multi_json (1.8.2)
       Using atomic (1.1.14)
       Using thread_safe (0.1.3)
       Using tzinfo (0.3.38)
       Using activesupport (4.0.1)
       Using builder (3.1.4)
       Using erubis (2.7.0)
       Using rack (1.5.2)
       Using rack-test (0.6.2)
       Using actionpack (4.0.1)
       Using mime-types (1.25)
       Using polyglot (0.3.3)
       Using treetop (1.4.15)
       Using mail (2.5.4)
       Using actionmailer (4.0.1)
       Using activemodel (4.0.1)
       Using activerecord-deprecated_finders (1.0.3)
       Using arel (4.0.1)
       Using activerecord (4.0.1)
       Using afm (0.2.0)
       Using coffee-script-source (1.6.3)
       Using execjs (2.0.2)
       Using coffee-script (2.2.0)
       Using thor (0.18.1)
       Using railties (4.0.1)
       Using coffee-rails (4.0.1)
       Using hashery (2.1.1)
       Using hike (1.2.3)
       Using jbuilder (1.5.2)
       Using jquery-rails (3.0.4)
       Using json (1.8.1)
       Using ruby-rc4 (0.1.5)
       Using ttfunk (1.0.3)
       Using pdf-reader (1.3.3)
       Using pg (0.17.0)
       Using bundler (1.3.2)
       Using tilt (1.4.1)
       Using sprockets (2.10.0)
       Using sprockets-rails (2.0.1)
       Using rails (4.0.1)
       Using rails_serve_static_assets (0.0.1)
       Using rails_stdout_logging (0.0.3)
       Using rails_12factor (0.0.2)
       Using rdoc (3.12.2)
       Using sass (3.2.12)
       Using sass-rails (4.0.1)
       Using sdoc (0.3.20)
       Using turbolinks (1.3.0)
       Using twitter-bootstrap-rails (2.2.8)
       Using uglifier (2.3.1)
       Your bundle is complete! It was installed into ./vendor/bundle
       Bundle completed (0.49s)
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Asset precompilation completed (2.11s)
       Cleaning assets
-----> WARNINGS:
       You have not declared a Ruby version in your Gemfile.
       To set your Ruby version add this line to your Gemfile:
       ruby '2.0.0'
       # See https://devcenter.heroku.com/articles/ruby-versions for more information.
       Using release configuration from last framework Ruby:
       --- 
       addons: 
       - heroku-postgresql:hobby-dev
       default_process_types: 
         rake: bundle exec rake
         console: bin/rails console
         web: bin/rails server -p $PORT -e $RAILS_ENV
         worker: bundle exec rake jobs:work
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for Multipack -> console, rake, web, worker

-----> Compiled slug size: 66.7MB
-----> Launching... done, v25
       http://avlats.herokuapp.com deployed to Heroku

1 个答案:

答案 0 :(得分:1)

除非你有一个正在运行的网络动态,否则Rails应用程序将无法在Heroku上运行。这就是你的heroku ps:scale web=1命令所做的一切 - 启动一个网络dyno。

Heroku是一种Pa​​aS解决方案,需要您设置资源,包括运行应用程序的dynos。一旦你缩放到一个非零数量的网络动态,你就不需要再做了 - 网络动力学将保持活跃状态​​,并随后推送到Heroku进行更新。如果dyno因为任何原因而崩溃,Heroku将启动另一个dyno以保持正在运行的dynos的数量。

所以,如果你需要一个且只有一个dyno,你应该没事。如果您需要根据负载上下调整应用程序,则需要解决此问题。