After staying up a little later than usual, I pushed the latest ASX value screener code to heroku - only for it to be rejected as now bundler was being used for everything. Bugger.
If you are following the instructions on converting a 2.3.5 rails app to use bundler and you get an error like this:
$ rake db:migrate --trace
(in ...)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant Rails::Boot::Bundler
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:105:in `const_missing'
You have probably misspelt preinitialize.rb in your config directory. Correct it and ensure that it is added into your git and you will get rid of this error.
Uploading to heroku was where the next trap lay in wait:
$ git push heroku master
Counting objects: 24, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17/17), done.
Writing objects: 100% (17/17), 5.86 KiB, done.
Total 17 (delta 12), reused 0 (delta 0)
-----> Heroku receiving push
-----> Rails app detected
-----> Gemfile detected, running Bundler version 0.9.9
-----> Bundler works best on the Bamboo stack. Please migrate your app:
http://docs.heroku.com/bamboo
Unresolved dependencies detected; Installing...
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 2, col 8: ` specs:' (ArgumentError)
from /usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
To avoid this, switch to the bamboo stack as recommended and bundler will work as expected.
Eventually, site back up - off to bed.
A blog about computer and electronics projects to make life just that little bit sweeter.
Showing posts with label heroku. Show all posts
Showing posts with label heroku. Show all posts
Sunday, January 2, 2011
Sunday, October 10, 2010
Hobo on Heroku
Ok, this was an ordeal that I don't want to have to repeat. So here's how to get your Hobo 1.0.0 app up and running on Heroku.
I'm not going over registering at Heroku or setting up Hobo. I'll presume that you are competent enough to do this yourself with the current guides on their respective sites.
The basics for this post is Tom Locke's recipe at HoboCentral. Also note that the Heroku default server is Aspen (aspen-mri-1.8.6).
So I set up a simple Hobo 1.0.0 app with 1 model. Using ruby 2.3.8, I can test on my app on the development server - no problems.
You will need to add a .gems file in your root directory, that should have all the extra gems that you require. Heroku has a good set, but in order for completeness and futureproofing - add all the ones that you require. Mine looked like this (it will change by the end of this post):
rails -v 2.3.8
will_paginate --version 2.3.11
hobosupport --version 1.0.0
hobofields --version 1.0.0 --ignore-dependencies
hobo --version 1.0.0 --ignore-dependencies
When submitting this to heroku it doesn't start as:
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
I kept hitting this and there appears to be a problem with Heroku's server of choice 'thin' and hobo and 2.3.8 rails - it will not work with 2.3.8 - this means that you will have to roll back to 2.3.5 to get it up and running. I don't know enough about thin, all I know is that getting the thin gem and trying locally has the same error.
After changing to 2.3.5 in config/environment.rb and .gems:
rails -v 2.3.5
pg --version 0.8.0
will_paginate --version 2.3.11
hobosupport --version 1.0.0
hobofields --version 1.0.0 --ignore-dependencies
hobo --version 1.0.0 --ignore-dependencies
(I also added pg's gem not 100% sure that I need it, but I saw it on heroku's example)
This gets you past the rails problems, only to hit:
/config/initializers/cookie_verification_secret.rb:7: undefined method `cookie_verifier_secret=' for ActionController::Base:Class (NoMethodError)
This seems to be a hobo version error, some new functionality that doesn't work in 2.3.5, my app doesn't require user protection, so I manually edited cookie_verification_secret.rb, commenting out that line.
This is not an ideal solution (in fact I would just call it a hack), you would probably need to step back to an older version of Hobo, I'm hoping to look ahead to Hobo 1.3.x so I'm not worried about finding the correct old hobo version.
Once I did this I was able to:
heroku rake db:migrate
...and finally the app is up and running.
Hope this helps someone.
I'm not going over registering at Heroku or setting up Hobo. I'll presume that you are competent enough to do this yourself with the current guides on their respective sites.
The basics for this post is Tom Locke's recipe at HoboCentral. Also note that the Heroku default server is Aspen (aspen-mri-1.8.6).
So I set up a simple Hobo 1.0.0 app with 1 model. Using ruby 2.3.8, I can test on my app on the development server - no problems.
You will need to add a .gems file in your root directory, that should have all the extra gems that you require. Heroku has a good set, but in order for completeness and futureproofing - add all the ones that you require. Mine looked like this (it will change by the end of this post):
rails -v 2.3.8
will_paginate --version 2.3.11
hobosupport --version 1.0.0
hobofields --version 1.0.0 --ignore-dependencies
hobo --version 1.0.0 --ignore-dependencies
When submitting this to heroku it doesn't start as:
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
I kept hitting this and there appears to be a problem with Heroku's server of choice 'thin' and hobo and 2.3.8 rails - it will not work with 2.3.8 - this means that you will have to roll back to 2.3.5 to get it up and running. I don't know enough about thin, all I know is that getting the thin gem and trying locally has the same error.
After changing to 2.3.5 in config/environment.rb and .gems:
rails -v 2.3.5
pg --version 0.8.0
will_paginate --version 2.3.11
hobosupport --version 1.0.0
hobofields --version 1.0.0 --ignore-dependencies
hobo --version 1.0.0 --ignore-dependencies
(I also added pg's gem not 100% sure that I need it, but I saw it on heroku's example)
This gets you past the rails problems, only to hit:
/config/initializers/cookie_verification_secret.rb:7: undefined method `cookie_verifier_secret=' for ActionController::Base:Class (NoMethodError)
This seems to be a hobo version error, some new functionality that doesn't work in 2.3.5, my app doesn't require user protection, so I manually edited cookie_verification_secret.rb, commenting out that line.
This is not an ideal solution (in fact I would just call it a hack), you would probably need to step back to an older version of Hobo, I'm hoping to look ahead to Hobo 1.3.x so I'm not worried about finding the correct old hobo version.
Once I did this I was able to:
heroku rake db:migrate
...and finally the app is up and running.
Hope this helps someone.
Subscribe to:
Posts (Atom)