colszowka/serious — pull request #21 by javierjulio (2013-05-05 01:32:08+00:00)
Title: Fix heroku app creation when using Serious CLI

I've started changes in a topic branch but this PR is incomplete. Hoping to get input so Serious CLI tool can deploy to Heroku Cedar stack successfully.

*Changes*

* Removed the stack definition so it deploys on their latest Cedar stack (I use Serious for my website on that stack successfully).
* Resolved the `:rubygems` deprecation warning by switching to using HTTPS URL in string format.
* The thin gem is now specified in the outputted `Gemfile` as Heroku suggests that over webrick.
* Serious CLI now runs `bundle install` as Heroku requires a `Gemfile.lock` file.

*Errors*

I'm running into an error building rdiscount on heroku that is using a newer version (2.0.7.2) than what I have on my site (1.6.8) so I know an older one works fine. Looks like it might require changes to StupidFormatter gem. Any ideas/suggestions?

```
Creating heroku app
Creating testserious... done, region is us
http://testserious.herokuapp.com/ | git@heroku.com:testserious.git
Git remote heroku added
Pushing to heroku - in 5 seconds
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (8/8), 959 bytes, done.
Total 8 (delta 0), reused 0 (delta 0)

-----> Ruby/Rack app detected
-----> Installing dependencies using Bundler version 1.3.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Installing builder (3.2.0)
Installing coderay (1.0.9)
Installing daemons (1.1.9)
Installing eventmachine (1.0.3)
Installing rack (1.5.2)
Installing rack-protection (1.5.0)
Installing rdiscount (2.0.7.2)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for random()... yes
checking for srandom()... yes
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... long
checking size of unsigned int... int
no int with size 4
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/lib
Gem files will remain installed in /tmp/build_3mnzka9brycp4/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2 for inspection.
Results logged to /tmp/build_3mnzka9brycp4/vendor/bundle/ruby/1.9.1/gems/rdiscount-2.0.7.2/ext/gem_make.out
An error occurred while installing rdiscount (2.0.7.2), and Bundler cannot
continue.
Make sure that `gem install rdiscount -v '2.0.7.2'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rack app

To git@heroku.com:testserious.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:testserious.git'
Failed to push to heroku!
Done!
```