Skip to content

Instantly share code, notes, and snippets.

@shageman
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shageman/db589f13c37c99251a53 to your computer and use it in GitHub Desktop.
Save shageman/db589f13c37c99251a53 to your computer and use it in GitHub Desktop.
Supporting non-root folders in Ruby Buildpack
I am trying to make the Ruby buildpack for a Rails application that does not have the app in the root folder. `git subtree` does not work, because code outside of the app folder is needed for the application.
Modified Ruby buildpack: https://github.com/shageman/heroku-buildpack-ruby
App to deploy: https://github.com/shageman/sportsball/tree/web_container_dir
2015-04-01T14:06:14.478874+00:00 heroku[api]: Deploy 4d4520e by stephan.hagemann@gmail.com
2015-04-01T14:06:14.478874+00:00 heroku[api]: Release v70 created by stephan.hagemann@gmail.com
2015-04-01T14:06:14.933494+00:00 heroku[web.1]: State changed from crashed to starting
2015-04-01T14:06:19.417538+00:00 heroku[web.1]: Starting process with command `GEM_PATH=/tmp/build_10dcdcd62042dff2368d9fa28dcebd80/web_container/vendor/bundle/ruby/2.2.0/gems PATH=./web_container/bin:/usr/local/bin:/usr/bin:/bin BUNDLE_GEMFILE=./web_container/Gemfile rails server -p 22773 -e $RAILS_ENV`
2015-04-01T14:06:21.122961+00:00 app[web.1]: /app/web_container/vendor/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)
2015-04-01T14:06:21.123004+00:00 app[web.1]: from /app/web_container/vendor/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
2015-04-01T14:06:21.123027+00:00 app[web.1]: from /app/web_container/config/boot.rb:4:in `<top (required)>'
2015-04-01T14:06:21.123049+00:00 app[web.1]: from ./web_container/bin/rails:7:in `require_relative'
2015-04-01T14:06:21.123071+00:00 app[web.1]: from ./web_container/bin/rails:7:in `<main>'
2015-04-01T14:06:22.692184+00:00 heroku[web.1]: State changed from starting to crashed
2015-04-01T14:06:22.679741+00:00 heroku[web.1]: Process exited with status 1
remote: "RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5
- RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-linux]
- INSTALLATION DIRECTORY: vendor/bundle/ruby/2.2.0
- RUBY EXECUTABLE: /tmp/build_3239750e3b552a02a438ef236bc86e73/web_container/vendor/ruby-2.2.0/bin/ruby
- EXECUTABLE DIRECTORY: vendor/bundle/ruby/2.2.0/bin
- SPEC CACHE DIRECTORY: /app/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /app/vendor/ruby-2.2.0/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- vendor/bundle/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- vendor/bundle/bin
- vendor/bundle/ruby/2.2.0/bin
- vendor/ruby-2.2.0/bin
- /app/bin
- /app/vendor/bundle/bin
- /app/vendor/bundle/ruby/1.9.1/bin
- vendor/bundle/ruby/1.9.1/bin
- /usr/local/bin
- /usr/bin
- /bin
- bin
- /tmp/codon/vendor/bin
- bin
- /usr/l
2015-04-02T03:45:09.688806+00:00 heroku[web.1]: Starting process with command `gem env && GEM_PATH=/tmp/build_c8b70136a834daf7b1c20865fc9d1e07/web_container/vendor/bundle/ruby/2.2.0 PATH=./web_container/bin:/usr/local/bin:/usr/bin:/bin BUNDLE_GEMFILE=./web_container/Gemfile rails server -p 54737 -e $RAILS_ENV`
2015-04-02T03:45:12.479728+00:00 app[web.1]: RubyGems Environment:
2015-04-02T03:45:12.479744+00:00 app[web.1]: - RUBYGEMS VERSION: 1.8.23
2015-04-02T03:45:12.479746+00:00 app[web.1]: - RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86_64-linux]
2015-04-02T03:45:12.479748+00:00 app[web.1]: - INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
2015-04-02T03:45:12.479750+00:00 app[web.1]: - RUBY EXECUTABLE: /usr/bin/ruby1.9.1
2015-04-02T03:45:12.479751+00:00 app[web.1]: - EXECUTABLE DIRECTORY: /usr/local/bin
2015-04-02T03:45:12.479753+00:00 app[web.1]: - RUBYGEMS PLATFORMS:
2015-04-02T03:45:12.479754+00:00 app[web.1]: - ruby
2015-04-02T03:45:12.479756+00:00 app[web.1]: - x86_64-linux
2015-04-02T03:45:12.479757+00:00 app[web.1]: - GEM PATHS:
2015-04-02T03:45:12.479759+00:00 app[web.1]: - /var/lib/gems/1.9.1
2015-04-02T03:45:12.479760+00:00 app[web.1]: - /app/.gem/ruby/1.9.1
2015-04-02T03:45:12.479762+00:00 app[web.1]: - GEM CONFIGURATION:
2015-04-02T03:45:12.479764+00:00 app[web.1]: - :update_sources => true
2015-04-02T03:45:12.479765+00:00 app[web.1]: - :verbose => true
2015-04-02T03:45:12.479766+00:00 app[web.1]: - :benchmark => false
2015-04-02T03:45:12.479768+00:00 app[web.1]: - :backtrace => false
2015-04-02T03:45:12.479769+00:00 app[web.1]: - :bulk_threshold => 1000
2015-04-02T03:45:12.479771+00:00 app[web.1]: - REMOTE SOURCES:
2015-04-02T03:45:12.479772+00:00 app[web.1]: - http://rubygems.org/
2015-04-02T03:45:12.541492+00:00 app[web.1]: /app/web_container/vendor/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot l
2015-04-02T03:55:44.159333+00:00 heroku[web.1]: Starting process with command `GEM_PATH=/tmp/build_0487d182194dfd40c75661bff3efbf0b/web_container/vendor/bundle/ruby/2.2.0 PATH=./web_container/bin:/usr/local/bin:/usr/bin:/bin BUNDLE_GEMFILE=./web_container/Gemfile gem env && GEM_PATH=/tmp/build_0487d182194dfd40c75661bff3efbf0b/web_container/vendor/bundle/ruby/2.2.0 PATH=./web_container/bin:/usr/local/bin:/usr/bin:/bin BUNDLE_GEMFILE=./web_container/Gemfile rails server -p 40527 -e $RAILS_ENV`
2015-04-02T03:55:45.973275+00:00 app[web.1]: RubyGems Environment:
2015-04-02T03:55:45.973293+00:00 app[web.1]: - RUBYGEMS VERSION: 2.4.5
2015-04-02T03:55:45.973294+00:00 app[web.1]: - RUBY VERSION: 2.2.0 (2014-12-25 patchlevel 0) [x86_64-linux]
2015-04-02T03:55:45.973296+00:00 app[web.1]: - INSTALLATION DIRECTORY: /app/web_container/vendor/ruby-2.2.0/lib/ruby/gems/2.2.0
2015-04-02T03:55:45.973297+00:00 app[web.1]: - RUBY EXECUTABLE: /app/web_container/vendor/ruby-2.2.0/bin/ruby
2015-04-02T03:55:45.973299+00:00 app[web.1]: - EXECUTABLE DIRECTORY: /app/web_container/vendor/ruby-2.2.0/bin
2015-04-02T03:55:45.973300+00:00 app[web.1]: - SPEC CACHE DIRECTORY: /app/.gem/specs
2015-04-02T03:55:45.973302+00:00 app[web.1]: - SYSTEM CONFIGURATION DIRECTORY: /app/vendor/ruby-2.2.0/etc
2015-04-02T03:55:45.973304+00:00 app[web.1]: - RUBYGEMS PLATFORMS:
2015-04-02T03:55:45.973305+00:00 app[web.1]: - ruby
2015-04-02T03:55:45.973306+00:00 app[web.1]: - x86_64-linux
2015-04-02T03:55:45.973308+00:00 app[web.1]: - GEM PATHS:
2015-04-02T03:55:45.973309+00:00 app[web.1]: - /app/web_container/vendor/ruby-2.2.0/lib/ruby/gems/2.2.0
2015-04-02T03:55:45.973310+00:00 app[web.1]: - /tmp/build_0487d182194dfd40c75661bff3efbf0b/web_container/vendor/bundle/ruby/2.2.0
2015-04-02T03:55:45.973312+00:00 app[web.1]: - GEM CONFIGURATION:
2015-04-02T03:55:45.973313+00:00 app[web.1]: - :update_sources => true
2015-04-02T03:55:45.973315+00:00 app[web.1]: - :verbose => true
2015-04-02T03:55:45.973316+00:00 app[web.1]: - :backtrace => false
2015-04-02T03:55:45.973317+00:00 app[web.1]: - :bulk_threshold => 1000
2015-04-02T03:55:45.973319+00:00 app[web.1]: - REMOTE SOURCES:
2015-04-02T03:55:45.973320+00:00 app[web.1]: - https://rubygems.org/
2015-04-02T03:55:45.973321+00:00 app[web.1]: - SHELL PATH:
2015-04-02T03:55:45.973323+00:00 app[web.1]: - ./web_container/bin
2015-04-02T03:55:45.973324+00:00 app[web.1]: - /usr/local/bin
2015-04-02T03:55:45.973325+00:00 app[web.1]: - /usr/bin
2015-04-02T03:55:45.973327+00:00 app[web.1]: - /bin
2015-04-02T03:55:46.062400+00:00 app[web.1]: /app/web_container/vendor/ruby-2.2.0/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- bundler/setup (LoadError)
± |web_container_dir ✗| → git push -f heroku web_container_dir:master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 309 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Ruby (non-standard root folder) app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.0
remote: -----> Installing dependencies using 1.7.12
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Using i18n 0.7.0
remote: Using minitest 5.5.0
remote: Using thread_safe 0.3.4
remote: Using json 1.8.1
remote: Using builder 3.2.2
remote: Using erubis 2.7.0
remote: Using rake 10.4.2
remote: Using rack 1.5.2
remote: Using mime-types 2.4.3
remote: Using arel 5.0.1.20140414130214
remote: Using thor 0.19.1
remote: Using bundler 1.7.12
remote: Using hike 1.2.3
remote: Using multi_json 1.10.1
remote: Using temple 0.7.5
remote: Using tilt 1.4.1
remote: Using execjs 2.2.2
remote: Using coffee-script-source 1.8.0
remote: Using pg 0.17.1
remote: Using rails_serve_static_assets 0.0.4
remote: Using rails_stdout_logging 0.0.3
remote: Using rdoc 4.2.0
remote: Using sass 3.2.19
remote: Using tzinfo 1.2.2
remote: Using rack-test 0.6.2
remote: Using mail 2.6.3
remote: Using sprockets 2.12.3
remote: Using slim 3.0.1
remote: Using uglifier 2.7.0
remote: Using coffee-script 2.3.0
remote: Using rails_12factor 0.0.3
remote: Using sdoc 0.4.1
remote: Using activesupport 4.1.9
remote: Using actionview 4.1.9
remote: Using jbuilder 2.2.6
remote: Using actionpack 4.1.9
remote: Using activemodel 4.1.9
remote: Using activerecord 4.1.9
remote: Using actionmailer 4.1.9
remote: Using railties 4.1.9
remote: Using sprockets-rails 2.2.2
remote: Using slim-rails 3.0.1
remote: Using coffee-rails 4.0.1
remote: Using jquery-rails 3.1.2
remote: Using rails 4.1.9
remote: Using sass-rails 4.0.5
remote: Using turbolinks 2.5.3
remote: Using trueskill 1.0.0 from https://github.com/benjaminleesmith/trueskill (at e404f45)
remote: Using app 0.0.1 from source at ../components/app
remote: Your bundle is complete!
remote: Gems in the groups development and test were not installed.
remote: It was installed into ./vendor/bundle
remote: Bundle completed (0.69s)
remote: Cleaning up the bundler cache.
remote: Removing puma (2.11.1)
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Asset precompilation completed (6.88s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby (non-standard root folder) -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 36.4MB
remote: -----> Launching... done, v53
remote: https://enigmatic-ridge-8035.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/enigmatic-ridge-8035.git
+ ac77212...8bf38b8 web_container_dir -> master (forced update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment