How to switch a Heroku Application from MySql to PostgreSql - ruby-on-rails

I am running my Heroku Application on MySql Database.
Now i want to switch to the PostgreSql for some reason.For that i change database.yml and also change my migration files as required by PostgreSql.
I also change DATABASE_URL and SHARED_DATABASE_URL for the same application.
But when i go to the application it is getting crashed.
Heroku:logs showing following error
/disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': can't activate rack (~> 1.0.0, runtime) for [], already activated rack-1.1.0 for ["thin-1.2.6"] (RuntimeError)
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:134:in `process'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/environment.rb:9
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:42:in `load_application'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:23:in `initialize'
from /home/heroku_rack/heroku.ru:29:in `new'
from /home/heroku_rack/heroku.ru:29
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:63:in `new'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:63:in `map'
from /home/heroku_rack/heroku.ru:18
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:11:in `new'
from /home/heroku_rack/heroku.ru:11
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:1:in `new'
from /home/heroku_rack/heroku.ru:1
==> dyno-1284675.log (crash) <==
/disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': can't activate rack (~> 1.0.0, runtime) for [], already activated rack-1.1.0 for ["thin-1.2.6"] (RuntimeError)
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:134:in `process'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
from /disk1/home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/config/environment.rb:9
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:42:in `load_application'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:23:in `initialize'
from /home/heroku_rack/heroku.ru:29:in `new'-----> Heroku receiving push
-----> Rails app detected
Compiled slug size is 15.3MB
-----> Launching.... done
from /home/heroku_rack/heroku.ru:29
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:63:in `new'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:63:in `map'
from /home/heroku_rack/heroku.ru:18
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:11:in `new'
from /home/heroku_rack/heroku.ru:11
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/181380_0fa1c59_dfd1-7eadaa54-533c-4617-b1de-bf74852a7afe/mnt/.gems/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:1:in `new'
from /home/heroku_rack/heroku.ru:1
-----> An error happened during the initialization of your app.
This may be due to a typo, wrong number of arguments, or calling a
function that doesn't exist.
Make sure the app is working locally in production mode, by running it
with RAILS_ENV (for Rails apps) or RACK_ENV (for Sinatra or other rack
apps) set to production. e.g. RAILS_ENV=production script/server.
Examine the backtrace above this message to debug.
==> cron-2153255.log (crash) <==
(in /disk1/home/slugs/181380_b09ba5c_aaf3-ed376a4c-936a-459f-b8c8-3111c45124e1/mnt)
config.gem: Unpacked gem CVS in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpacked gem CVS in vendor/gems not in a versioned directory. Giving up.
rake aborted!
undefined method `serve_static_assets=' for #<Rails::Configuration:0x2aec8dff9cc8>
(See full trace by running task with --trace)
-----> Your application crashed.
Examine the backtrace above this message to debug.
I want Steps to be followed while switching through database for Heroku or how to avoid the above mentioned Error.
EDITED:-
my .gems file is as follows
rails -v 2.3.8
spreadsheet --version 0.6.4
spreadsheet-excel --version 0.3.5.1
rack --version 1.1.0
money --version 2.2.0
fastercsv --version 1.5.3
xml-mapping --version 0.8.1
It gives same error when i change 'rack --version 1.1.0' ot 'rack --version 1.0.0'
Regards,
Salil Gaikwad

I don't know why but it works after comment out following line in the config/environments/production.rb
config.serve_static_assets = true
Now i want to know is comment out above line occur some problem in future? AND
what is the use of that code?

Related

Heroku Invalid database_url with mongohq

Im trying to deploy my application in heroku. My app uses mongohq for the database. I have added the respective add-on to my app.
When deploying the app i get this error.
Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
** Notice: The native BSON extension was not loaded. **
For optimal performance, use of the BSON extension is recommended.
To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:
gem install bson_ext
If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
rake aborted!
Invalid DATABASE_URL
(erb):9:in `rescue in <main>'
(erb):6:in `<main>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application/configuration.rb:106:in `database_configuration'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:174:in `block (2 levels) in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/railtie.rb:173:in `block in <class:Railtie>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:30:in `run'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/initializable.rb:54:in `run_initializers'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:215:in `initialize!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/tmp/build_3o2y20a7ewhl/config/environment.rb:5:in `<top (required)>'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:189:in `require_environment!'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:249:in `block in run_tasks_blocks'
/tmp/build_3o2y20a7ewhl/vendor/bundle/ruby/2.0.0/gems/sprockets-rails-2.0.0/lib/sprockets/rails/task.rb:54:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby/Rails app
It looks like is trying to write the DATABASE_URL in database.yml but i don't use one. I just use monogoid.yml and set the proper ENV var MONGOHQ_URL.
Do i need to setup any configuration so heroku can detect i'm using mongo as my database?
EDIT:
My mongoid.yml file looks like this.
production:
sessions:
default:
uri: <%= ENV['MONGOHQ_URL'] %>
I have read that article, i'm following those steps.
In case anyone is going through the same, i had in my application.rb a reference to active record that i needed to take away:
#require "active_record/railtie"
Also double check your environments files, in some cases you could have some active_record configuration code.
Hope it helps.

`initialize': No such file or directory - getaddrinfo (Errno::ENOENT) when Rails new app

I try to create a rails app in rails 4.00 with ruby ruby-2.0.0-p247. While bundle install processes, it shows an error: initialize: No such file or directory. Below is output of error
run bundle install
/home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `initialize': No such file or directory - getaddrinfo (Errno::ENOENT)
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `open'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:878:in `block in connect'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in `connect'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1449:in `begin_transport'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1402:in `transport_request'
from /home/gotzila/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:1376:in `request'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/vendor/net/http/persistent.rb:935:in `request'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:202:in `fetch'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:242:in `fetch_dependency_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:151:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:154:in `fetch_remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/fetcher.rb:106:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `block in remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `each'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:235:in `remote_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:163:in `fetch_specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/source/rubygems.rb:67:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:192:in `block (2 levels) in index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `each'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:189:in `block in index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/index.rb:9:in `build'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:185:in `index'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:179:in `resolve'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:114:in `specs'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/definition.rb:109:in `resolve_remotely!'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/installer.rb:83:in `run'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/installer.rb:14:in `install'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/cli.rb:247:in `install'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/task.rb:27:in `run'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/vendor/thor.rb:344:in `dispatch'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/vendor/thor/base.rb:434:in `start'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/bin/bundle:20:in `block in <main>'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
from /home/gotzila/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/bin/bundle:20:in `<main>'
Fetching gem metadata from https://rubygems.org/....Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
What should i do to solve this problem?
I just had a similar issue and after reinstalling rvm (a headache) a couple days later it came back. This time I tried using comments to isolate which gems in my Gemfile were causing the problem. I noticed it was new gems. Then I tried to simply
gem install <problem_gem>
ERROR: Could not find a valid gem 'problem_gem' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/latest_specs.4.8.gz)
This made me think I wasn't connected to the internet. Once I connected again.
bundle worked!
bundle install
Clean and Reinstall new RVM and then try again..
Follow this link to install new RVM:
https://rvm.io/rvm/install
I faced similar problem and I installed the current stable version rvm 1.21.13 (stable) of RVM to get rid of this. Although my ruby version was 1.9.3 instead of 2.x

Rails 3-2-stable on Ruby 2.0, Psych error on bundle

Due to an issue in Sprockets that fails in Ruby 2.0, I need to update my Rails version to the latest version. As a result, my Gemfile looks like this:
gem 'rails', git: 'git://github.com/rails/rails.git', branch: "3-2-stable"
which then results in the stack trace shown below. Rails edge also shows the same problem, though they are running their test suite against Ruby 2.0 so it must be compatible.
So I'm guessing there may be dependent libraries that either Rails or Ruby were built against that aren't playing nice with Ruby 2.0-preview1
> bundle
Updating git://github.com/rails/rails.git
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping values are not allowed in this context at line 8 column 35 (Psych::SyntaxError)
from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:153:in `parse'
from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:129:in `load'
from .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:491:in `from_yaml'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler.rb:294:in `block in load_gemspec_uncached'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler.rb:291:in `chdir'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler.rb:291:in `load_gemspec_uncached'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler.rb:282:in `load_gemspec'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:411:in `block in load_spec_files'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:410:in `each'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:410:in `load_spec_files'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:799:in `load_spec_files'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:381:in `local_specs'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/source.rb:774:in `specs'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:491:in `block in converge_locked_specs'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:480:in `each'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:480:in `converge_locked_specs'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:166:in `resolve'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/bin/bundle:14:in `block in <top (required)>'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
from .rvm/gems/ruby-2.0.0-preview1#global/gems/bundler-1.2.1/bin/bundle:14:in `<top (required)>'
from .rvm/gems/ruby-2.0.0-preview1#global/bin/bundle:19:in `load'
from .rvm/gems/ruby-2.0.0-preview1#global/bin/bundle:19:in `<main>'
from .rvm/gems/ruby-2.0.0-preview1#album_releases/bin/ruby_noexec_wrapper:14:in `eval'
from .rvm/gems/ruby-2.0.0-preview1#album_releases/bin/ruby_noexec_wrapper:14:in `<main>'
This was a bug in Bundler, as described here: https://github.com/rails/rails/issues/8136
It has since been fixed.
I had this issue. It was caused by psych seeing code like "this:" in a heredoc within a gemspec (Prawn, in my case), and thinking it was a hash. I believe it's a regression in 2.0.0-preview1, because i had had ruby-head prior, and did not hit this issue.

heroku db:pull errors

Well, I used to be able to push and pull with heroku, but it just asked me to upgrade taps, so I did. Once I did that I started getting errors that look like this when I attempt a db:pull
Receiving schema
/Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3:
in `require': no such file to load -- rubygems (LoadError)
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3
/Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3:
in `require': no such file to load -- rubygems (LoadError)
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3
/Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3:
in `require': no such file to load -- rubygems (LoadError)
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3
Schema: 100% |==========================================| Time: 00:00:07
Receiving indexes
/Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3:
in `require': no such file to load -- rubygems (LoadError)
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/bin/schema:3
schema_migrat: 100% |==========================================| Time: 00:00:00
Receiving data
3 tables, 600 records
/Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/errors.rb:62:
in `check': SQLite3::SQLException: PRIMARY KEY must be unique (Sequel::DatabaseError)
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/resultset.rb:56:in `check'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/resultset.rb:48:in `commence'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/resultset.rb:38:in `initialize'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/statement.rb:136:in `new'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/statement.rb:136:in `execute'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/database.rb:232:in `execute_batch'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/database.rb:163:in `prepare'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.2.5/lib/sqlite3/database.rb:231:in `execute_batch'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:130:in `_execute'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/logging.rb:28:in `log_yield'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:130:in `_execute'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:71:in `hold'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:117:in `_execute'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/adapters/sqlite.rb:87:in `execute_dui'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:552:in `execute_dui'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `import'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `each'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `import'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/query.rb:223:in `_transaction'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/query.rb:209:in `transaction'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/connection_pool/threaded.rb:84:in `hold'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/connecting.rb:226:in `synchronize'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/database/query.rb:207:in `transaction'
from /Library/Ruby/Gems/1.8/gems/sequel-3.20.0/lib/sequel/dataset/actions.rb:243:in `import'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/data_stream.rb:315:in `import_rows'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/data_stream.rb:142:in `fetch_remote'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:308:in `pull_data_from_table'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:301:in `loop'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:301:in `pull_data_from_table'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:284:in `pull_data'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:278:in `each'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:278:in `pull_data'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:253:in `run'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:203:in `call'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:203:in `catch_errors'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/operation.rb:246:in `run'
from /Library/Ruby/Gems/1.8/gems/taps-0.3.21/lib/taps/cli.rb:171:in `clientxfer'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/lib/heroku/commands/db.rb:152:in `taps_client'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/lib/heroku/commands/db.rb:25:in `pull'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/lib/heroku/command.rb:49:in `send'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/lib/heroku/command.rb:49:in `run_internal'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/lib/heroku/command.rb:21:in `run'
from /Library/Ruby/Gems/1.8/gems/heroku-1.19.1/bin/heroku:13
from /usr/bin/heroku:19:in `load'
from /usr/bin/heroku:19
Eventually I ended up trying to upgrade everything in sight, including:
sequel
heroku
rubygems
and of course taps
The answer was to restart my webrick server, gosh i feel dumb.

How do I upgrade system gems on heroku?

I'm running on a heroku bamboo-mri-1.9.2 stack and getting the following message when I push to heroku: I'm stumped:
Installing hoe (2.9.1) /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/installer.rb:170:in `install': hoe requires RubyGems version >= 1.4. Try 'gem update --system' to update RubyGems itself. (Gem::InstallError)
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `block in run'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `block in each'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/bin/bundle:13:in `<top (required)>'
from /usr/ruby1.9.2/bin/bundle:19:in `load'
from /usr/ruby1.9.2/bin/bundle:19:in `<main>'
FAILED: http://docs.heroku.com/bundler
any ideas? Thanks in advance.
I would exclude the 'hoe' gem from what you send up to github.
group :test, :development do
gem "hoe"
# other gems you want to exclude from github
end
Then set in your heroku variables:
heroku config:add BUNDLE_WITHOUT="development:test"
Read More: http://devcenter.heroku.com/articles/bundler
Try using different versions of how:
hoe 2.10.0
hoe 2.9.6
hoe 2.9.5
hoe 2.9.4
hoe 2.9.3
Add those one at a time, bundle, and then push to heroku.

Resources