2016-03-31 6 views
0

Dokku 0.5.3を使用すると、Ruby/Rackアプリを配備する際に問題が発生します.Bundlerは:productionグループに自分の宝石をインストールしません。その宝石はしていないので、それはdm-postgres-adapterを要求することはできませんのでDokkuのRubyアプリケーションを配備する:なぜBundlerは「生産なしに」設定するのですか?

Counting objects: 114, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (91/91), done. 
Writing objects: 100% (114/114), 13.76 KiB | 0 bytes/s, done. 
Total 114 (delta 53), reused 0 (delta 0) 
-----> Cleaning up... 
-----> Building my-app from herokuish... 
-----> Adding BUILD_ENV to build environment... 
-----> Ruby app detected 
-----> Compiling Ruby/Rack 
-----> Using Ruby version: ruby-2.3.0 
-----> Installing dependencies using bundler 1.11.2 
     Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
     Fetching gem metadata from https://rubygems.org/......... 
     Fetching version metadata from https://rubygems.org/... 
     Fetching dependency metadata from https://rubygems.org/.. 
     Fetching git://github.com/julienma/dm-types.git 
     Installing bcrypt 3.1.11 with native extensions 
     Installing backports 3.6.8 
     Installing addressable 2.4.0 
     Installing daemons 1.2.3 
     Using json 1.8.3 
     Installing fastercsv 1.5.5 
     Installing json_pure 1.8.3 
     Installing multi_json 1.11.2 
     Installing stringex 1.5.1 
     Installing uuidtools 2.1.5 
     Installing multipart-post 2.0.0 
     Installing eventmachine 1.2.0.1 with native extensions 
     Installing hashie 3.4.3 
     Installing rack 1.6.4 
     Installing tilt 2.0.2 
     Using bundler 1.11.2 
     Installing bcrypt-ruby 3.1.5 
     Installing dm-core 1.2.1 
     Installing faraday 0.9.2 
     Installing rack-protection 1.5.3 
     Installing rack-test 0.6.3 
     Installing faraday_middleware 0.9.2 
     Installing dm-aggregates 1.2.0 
     Installing dm-constraints 1.2.0 
     Installing dm-migrations 1.2.0 
     Installing dm-serializer 1.2.2 
     Installing dm-transactions 1.2.0 
     Using dm-types 1.2.2 from git://github.com/julienma/dm-types.git (at [email protected]) 
     Installing dm-timestamps 1.2.0 
     Installing dm-validations 1.2.0 
     Installing sinatra 1.4.7 
     Installing instagram 1.1.6 
     Installing sinatra-contrib 1.4.6 
     Installing data_mapper 1.2.0 
     Installing thin 1.6.4 with native extensions 
     Bundle complete! 12 Gemfile dependencies, 35 gems now installed. 
     Gems in the groups development, test and production were not installed. 
     Bundled gems are installed into ./vendor/bundle. 
     Bundle completed (42.90s) 
     Cleaning up the bundler cache. 

--- 
     addons: [] 
     config_vars: 
     LANG: en_US.UTF-8 
     RACK_ENV: production 
     default_process_types: 
     rake: bundle exec rake 
     console: bundle exec irb 
     web: bundle exec thin start -R config.ru -e $RACK_ENV -p $PORT 
-----> Discovering process types 
     Procfile declares types -> web 
-----> Releasing my-app (dokku/my-app:latest)... 
-----> Deploying my-app (dokku/my-app:latest)... 
-----> Attempting to run scripts.dokku.predeploy from app.json (if defined) 
-----> App Procfile file found (/home/dokku/my-app/DOKKU_PROCFILE) 
-----> DOKKU_SCALE file not found in app image. Generating one based on Procfile... 
-----> New DOKKU_SCALE file generated 
=====> web=1 
-----> Running pre-flight checks 
     For more efficient zero downtime deployments, create a file CHECKS. 
     See http://dokku.viewdocs.io/dokku/checks-examples.md for examples 
     CHECKS file not found in container: Running simple container check... 
-----> Waiting for 10 seconds ... 
remote: App container failed to start!! 
=====> my-app web container output: 
     /app/vendor/bundle/ruby/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require': cannot load such file -- dm-postgres-adapter (LoadError) 
     from /app/vendor/bundle/ruby/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in `require_with_backports' 
     from /app/vendor/bundle/ruby/2.3.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:163:in `load_adapter' 
     from /app/vendor/bundle/ruby/2.3.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:133:in `adapter_class' 
     from /app/vendor/bundle/ruby/2.3.0/gems/dm-core-1.2.1/lib/dm-core/adapters.rb:13:in `new' 
     from /app/vendor/bundle/ruby/2.3.0/gems/dm-core-1.2.1/lib/dm-core.rb:230:in `setup' 
     from /app/controllers/app.rb:38:in `<top (required)>' 
     from /app/config.ru:1:in `require' 
     from /app/config.ru:1:in `block in <main>' 
     from /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval' 
     from /app/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize' 
     from /app/config.ru:1:in `new' 
     from /app/config.ru:1:in `<main>' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `eval' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in `load' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:42:in `for' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:170:in `load_adapter' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:74:in `start' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in `run_command' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in `run!' 
     from /app/vendor/bundle/ruby/2.3.0/gems/thin-1.6.4/bin/thin:6:in `<top (required)>' 
     from /app/vendor/bundle/ruby/2.3.0/bin/thin:23:in `load' 
     from /app/vendor/bundle/ruby/2.3.0/bin/thin:23:in `<main>' 
     Using rack adapter 
=====> end my-app web container output 
To ssh://[email protected]:22/my-app 
! [remote rejected] patch-dm-postgres-adapter-deploy -> master (pre-receive hook declined) 
error: failed to push some refs to 'ssh://[email protected]:22/my-app' 

ルビー・エラーがある:

source 'https://rubygems.org' 

ruby '2.3.0' 

gem 'bundler' 
gem 'sinatra' 
gem 'sinatra-contrib' 
gem 'json' 
gem 'thin' 
gem 'instagram' 
gem 'data_mapper' 
gem 'dm-types', 
    :git => 'git://github.com/julienma/dm-types.git', 
    :branch => 'gem-v1.2.2-with-frozen-nilclass-fix' 

gem 'dm-postgres-adapter', :group => :production 

group :development, :test do 
    gem 'dm-sqlite-adapter' 
    gem 'dotenv' 
    gem 'pry' 
end 

は、ここで私は私のレポはdokkuするプッシュする出力です:ここで

は私のGemfileですインストールされています。 バンドラーはまた、 Gems in the groups development, test and production were not installed.と述べています。ここで

は私が知っているものだ:

  • 私はBUNDLE_WITHOUT: productionを含むローカル.bundler/configを持っていますが、これは.gitignore D」です。 dokkuインスタンスで
  • が、これは dokku run my-app bundle configが私を与えるものである:

    Settings are listed in order of priority. The top value will be used. 
    without 
    Set for your local app (/app/.bundle/config): "development:test:production" 
    Set via BUNDLE_WITHOUT: "development:test" 
    Set for the current user (/app/.bundle/config): "development:test:production" 
    ... 
    

without句のdevelopment:testはどこから来るのか、私は理解することができますが、私はどのように理解するために失われた時には本当によなぜproductionもそこにあります。

初めてをデプロイする前に、ENV var BUNDLE_WITHOUT: development:testを設定しようとしました。これは考慮されていますが、先にローカルのbundler設定があります。これは既にproductionを除いています。


私は手動で/home/dokku/my-app/cache/.bundle/configを編集することによって、これを解決し、productionを削除します。

BUNDLE_WITHOUT: development:test 

再びプッシュした後、バンドラーが正常に私のproduction宝石をインストールしました。

しかし、サーバー上の構成ファイルを手動で編集して機能させる必要はありません。だから、

、QUESTION:

  • Dokkuに展開する際に、なぜバンドラーによってproductionグループを無視していますか?
  • 私のproduction宝石をインストールするにはどうしたらいいですか?

ありがとうございます!

答えて

0

heroku buildpackを使用しているため、最新のbuildpackで正しいデフォルト設定が問題になっていますか?

関連する問題