dobtco / procure-io

*NOT CURRENTLY MAINTAINED* Procurement software for the 21st century.
Other
40 stars 16 forks source link

Heroku deployment instructions do not work #192

Closed daguar closed 11 years ago

daguar commented 11 years ago

I spent much of yesterday trying to successfully deploy; eventually I was able to at least get to a functional deploy before encountering other errors.

Because I had to do so much tweaking to get to deployment, before I can issue a pull request, I need to re-run my changes with a vanilla deployment, and make sure the fixes are isolated. But I wanted to add an issue to document these for the time being.

Problem 1: This rails console statement does not run: Organization.first.owners_team << User.first

Potential Fix: Organization.first.owners_team.users << User.first seems to work, though this was a fairly naive fix based on a quick read of the schema.

Problem 2: Asset compilation appears successful on Heroku, but the assets aren't actually correctly compiled/served.

Potential Fix: In Gemfile, I renamed group :heroku to group :production, and I also precompiled assets locally per Heroku instructions here: https://devcenter.heroku.com/articles/rails-asset-pipeline#compiling-assets-locally

(Local precompilation was done before the Gemfile change, and so may be unnecessary.)

Problem 3: Current Procfile uses "rails server thin" as the web dyno. As-is, this'll just yield 500 errors, because binstubs have been ignored in .Gitignore and so the vserver will try to run "rails server" but will not have have bin/rails to run it (this yields the same output as trying to run rails server from a directory where there is no Rails project, i.e. usage info).

Potential Fix: I actually had to swap out Unicorn for Thin to make it work, but I think the issue is that (a) binstubs are ignored, and (b) the instructions omit running the new Rails 4.0-style binstub task (rake rails:update:bin) which generates the binstub, per http://edgeguides.rubyonrails.org/4_0_release_notes.html#railties-notable-changes

More broadly on this front, I noticed the removal of Travis-CI. Moving forward, I think it makes sense to re-add this to identify these deployment problems earlier, as well as identify a stable deploy environment that is validated with new changes.