Last active
December 26, 2015 04:09
-
-
Save dlovell/7091253 to your computer and use it in GitHub Desktop.
test of basic middleman heroku app with ruby 1.9.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create an app | |
heroku auth:whoami | |
app_name=$(perl -ne 'print $1 if m/^Creating ([\w\-]+)\.\.\./' <(heroku create)) | |
echo "created app_name=$app_name" | |
echo "destroy with" | |
echo "heroku destroy --app $app_name --confirm $app_name" | |
# | |
heroku config:set --app $app_name BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git | |
# per https://devcenter.heroku.com/articles/ruby-versions#migration | |
heroku config:set --app $app_name PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin | |
heroku config --app $app_name -s | grep PATH | |
heroku run --app $app_name "ruby -v" | |
# create content | |
cd ~ | |
middleman init $app_name --rack | |
cd $app_name | |
perl -i.bak -pe 's/^(source.*)$/$1\n\nruby "1.9.3"/' Gemfile | |
echo 'web: bundle exec thin start -p $PORT' > Procfile | |
cat -- > .buildpacks <<EOF | |
https://github.com/heroku/heroku-buildpack-ruby.git | |
https://github.com/hashicorp/heroku-buildpack-middleman.git | |
EOF | |
# bundle install and create repo | |
source ~/.rvm/scripts/rvm | |
bundle install | |
git init | |
git add . | |
git commit -a -m 'initial commit' | |
heroku git:remote -a $app_name | |
# make sure you can push to heroku | |
keyfile=~/.ssh/id_rsa | |
if [[ ! -f $keyfile ]]; then | |
ssh-keygen -t rsa -P "" -f $keyfile | |
fi | |
heroku keys:add $keyfile.pub | |
# push | |
git push heroku master | |
# results in following error | |
# =====> Downloading Buildpack: https://github.com/hashicorp/heroku-buildpack-middleman.git | |
# =====> Detected Framework: Middleman | |
# Your Ruby version is 1.9.2, but your Gemfile specified 1.9.3 | |
# | |
# ! Push rejected, failed to compile Multipack app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment