taps migration failing from sqlite to postgres rails4, ruby 1.9.3

我的梦境 提交于 2019-12-01 03:11:42

问题


I am trying to migrate my Rails app to Postgresql for heroku however i can't get taps to get the data from my SQLite3 database, here is what i have tried:

Create the Postgres database user for the new databases

$ createuser f3
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y

EDIT - Updated command below - use this instead

$ createuser f3 -d -s

Create the required databases

$ createdb -Of3 -Eutf8 f3_development
$ createdb -Of3 -Eutf8 f3_test

Update the Gemfile

gem 'sqlite3'
gem 'pg'
gem 'taps'
$ bundle

Update database.yml

#development:
#  adapter: sqlite3
#  database: db/development.sqlite3
#  pool: 5
#  timeout: 5000

development:
  adapter: postgresql
  encoding: unicode
  database: f3_development
  pool: 5
  username: f3
  password:

#test:
#  adapter: sqlite3
#  database: db/test.sqlite3
#  pool: 5
#  timeout: 5000

test:
  adapter: postgresql
  encoding: unicode
  database: f3_test
  pool: 5
  username: f3
  password:

Start the taps server on the sqlite database

$ taps server sqlite://db/development.sqlite3 user password

Migrate the data

$ taps pull postgres://f3@localhost/f3_development http://user:password@localhost:5000

This yields an error:

MacBook-Pro:devise_example-master david$ taps pull postgres://david:abc123@localhost/f3_development http://user:password@localhost:5000
Receiving schema
Unable to fetch tables information from http://user:password@localhost:5000. Please check the server log.

Anyone got a fix for this, (I cant just switch to Ruby 1.9.2 using rvm cause my app use a lot of gems that aren't working for the old ruby).

And below is the Log from the taps sqlite server when pull is issued

MacBook-Pro:devise_example-master david$ taps server sqlite://db/development.sqlite3 user password
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2013-08-13 21:38:23] INFO  WEBrick 1.3.1
[2013-08-13 21:38:23] INFO  ruby 1.9.3 (2013-06-27) [x86_64-darwin12.4.0]
[2013-08-13 21:38:23] INFO  WEBrick::HTTPServer#start: pid=4357 port=5000
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET / HTTP/1.1" 200 - 0.0011
localhost - - [13/Aug/2013:21:38:32 CEST] "GET / HTTP/1.1" 200 31
- -> /
127.0.0.1 - user [13/Aug/2013 21:38:32] "POST /sessions HTTP/1.1" 200 - 0.0070
localhost - - [13/Aug/2013:21:38:32 CEST] "POST /sessions HTTP/1.1" 200 46
- -> /sessions
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `map'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in `encode'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in `block in <class:Server>'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0112
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `map'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in `encode'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in `block in <class:Server>'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0048
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `map'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in `encode'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in `block in <class:Server>'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0043
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `map'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in `encode'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in `block in <class:Server>'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0046
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in 

..................

lib/ruby/1.9.1/webrick/httpserver.rb:138:in service' /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:inrun' /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in block in start_thread' ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations An error occurred but Hoptoad was not notified. To use Hoptoad, please install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"] 127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0045 localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522 - -> /sessions/6475330165/pull/table_names Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations: /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:invalenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in block in arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:inmap' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:inencode' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in block in <class:Server>' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:incall' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in block in route' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:ininstance_eval'

......

ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0050
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'

......

 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0045
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'

......

 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0159
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in 

.......

 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0048
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names
Rack::Utils::OkJson::Error - cannot encode Symbol: :schema_migrations:
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:427:in `valenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `block in arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `map'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in `arrenc'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in `encode'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/taps-0.3.24/lib/taps/server.rb:157:in `block in <class:Server>'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/deflater.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/auth/basic.rb:25:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'
 /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
 /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
ERROR: Rack::Utils::OkJson::Error: cannot encode Symbol: :schema_migrations
An error occurred but Hoptoad was not notified. To use Hoptoad, please
install the 'hoptoad_notifier' gem and set ENV["HOPTOAD_API_KEY"]
127.0.0.1 - user [13/Aug/2013 21:38:32] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 - 0.0045
localhost - - [13/Aug/2013:21:38:32 CEST] "GET /sessions/6475330165/pull/table_names HTTP/1.1" 500 522
- -> /sessions/6475330165/pull/table_names

回答1:


This worked for me:

  1. I went up one directory from my project directory then did the following
  2. gem install taps
  3. gem uninstall rack
  4. gem install rack --version 1.0.1

Start the sqlite server from the project directory, in the 'one up directory' run:

taps pull postgres://f3@localhost/f3_development http://user:password@localhost:5000

Then did the migration as before and it worked. I had rack 1.5.2 installed so I had to remove that and replace it with rack 1.0.1. I'm using ruby 2.0.0-p0 and rails 4.0.0.beta1

It seems only the pull command needed the old version of rack so the server could run on the newer 1.5.2 version...




回答2:


@David Karlsson's answer worked for me too. Except I had to update back rack once taps has completed the pull

gem update rack

and run bundle install to get back all my gems working.

I'm on rails 3.2 and ruby 1.9.3




回答3:


Thank you @DavidKarlsson, just adding to your answer, there is no need to uninstall the existing rack. Following the recommendation of @hak8or in https://github.com/ricardochimal/taps/issues/128 I used a Gemfile to ensure usage of rack version 1.0.1. But after I installed I had various versions of rack

$ gem uninstall 'rack'

Select gem to uninstall:
1. rack-1.0.1
2. rack-1.4.4
3. rack-1.4.5
4. rack-1.5.2
5. All versions

and did not want to uninstall them, because that could affect other projects I have in the same machine. When I run taps it would use the latest, rack-1.5.2, so what I did was to run taps using bundle exec, in my case

bundle exec taps server sqlite://db/development.sqlite3 root root

Hope it helps!



来源:https://stackoverflow.com/questions/18217886/taps-migration-failing-from-sqlite-to-postgres-rails4-ruby-1-9-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!