Skip to content

Instantly share code, notes, and snippets.

@jmccaffrey
Created November 15, 2012 22:55
Show Gist options
  • Save jmccaffrey/4082108 to your computer and use it in GitHub Desktop.
Save jmccaffrey/4082108 to your computer and use it in GitHub Desktop.
Upgrading a rails 2.3.5 app from aspen to cedar
These are my notes while updating a sample app from aspen to cedar.
The app is just a demonstration of using formtastic with haml, and getting it to work on heroku.
heroku plugins:install https://github.com/heroku/heroku-aspen-migrate
Could not initialize heroku-aspen-migrate: no such file to load -- heroku/client/pgbackups
Are you attempting to install a Rails plugin? If so, use the following:
gem update heroku
heroku plugins:install https://github.com/heroku/heroku-aspen-migrate
heroku maintenance:on -a mccaffrey-formtastic
heroku aspen:migrate -a mccaffrey-formtastic
Creating Cedar app mccaffrey-formtastic-cedar... done
Discovering database addon... done, heroku-postgresql:dev
Verifying pgbackups installation... done
Adding addons to Cedar app... done
Creating database backup from mccaffrey-formtastic... . done
Restoring database backup to mccaffrey-formtastic-cedar... ... done
Copying config... done
Cloning original app into temp dir... done
Converting gems to bundler...
/private/var/folders/3B/3BxYeyNUFGCDdNZoz7Colk+++TI/-Tmp-/d20121115-6157-1pki5eu/
Gemfile:4:in `build': undefined method `ruby' for #<Bundler> (NoMethodError)
from /Users/john/.rvm/gems/ree-1.8.7-2010.02@global/gems/bundler-1.0.3/lib/bundler.rb:128
#bundler problem?
bundle --version
=> 1.0.3
gem update bundler
=> 1.2.2
#tried again
heroku aspen:migrate -a mccaffrey-formtastic
Creating Cedar app mccaffrey-formtastic-cedar... failed
! Name is already taken
#went to heroku.com in browser to delete it and try again
#failed to start, need to clone and connect to see what's up
git clone git@heroku.com:mccaffrey-formtastic-cedar -o heroku
Cloning into mccaffrey-formtastic-cedar...
! Invalid path.
! Syntax is: git@heroku.com:<app>.git where <app> is your app's name.
fatal: The remote end hung up unexpectedly
needed to add '.git' to the end
# now I can try: heroku logs
lots of deprecation warnings Gem.source_index...
...
/app/vendor/bundle/ruby/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x7ff0374dee80> (NameError)
.....
# rubygems issue?
https://gist.github.com/807008
http://www.redmine.org/issues/7516#note-3
added this to config/environment.rb
# after
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
...
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end
pushed: git push heroku master
check db migration version
heroku run rake db:version
no such file to load -- rake/rdoctask
http://stackoverflow.com/questions/7826442/no-such-file-to-load-rdoc-task
add to Gemfile
gem "rdoc"
gem "rdoc-data"
http://matthew.mceachen.us/blog/howto-fix-rake-rdoctask-is-deprecated-use-rdoc-task-instead-1169.html
changed Rakefile
require 'rake/rdoctask'
to require 'rdoc/task'
git push heroku master && heroku run rake db:version
...
Missing these required gems:
haml
formtastic
...
added to Gemfile
gem "formtastic", "0.9.1"
gem "haml", "2.2.6"
bundle update
commit and push
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
...
oops, bundle install, not bundle update
commit and push
looks all good
heroku open to confirm
with the few cycles of trying to fix gems, and looking up little issues the migration took about an hour. If I had kept the app up to date, it wouldn't have been an issue.
update and run locally, then migrate!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment