点击迁移失败从sqlite到postgres rails4,ruby 1.9.3

我正在尝试将我的Rails应用程序迁移到Postgresql for heroku但是我无法从我的SQLite3数据库获取数据,这是我尝试过的:

为新数据库创建Postgres数据库用户

$ 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 

编辑 – 更新下面的命令 – 改为使用它

 $ createuser f3 -d -s 

创建所需的数据库

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

更新Gemfile

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

更新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: 

在sqlite数据库上启动tap服务器

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

迁移数据

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

这会产生错误:

 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. 

任何人都得到了解决方案,(我不能使用rvm切换到Ruby 1.9.2因为我的应用程序使用了很多不适用于旧ruby的gem)。

以下是发布pull时从tap sqlite服务器的日志

 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 ' /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 ' /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 ' /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 ' /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:in /usr/ service' /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in /rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb service' /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in运行’/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 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 block in arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in okjson.rb 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 438 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 arrenc 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’ block in arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:438:in 。 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 usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack- arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in encode’ arrenc' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/utils/okjson.rb:410:in : 157:在block in ' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in block in ' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in call’ block in ' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:865:in 1.0 / lib / sinatra / base.rb:865: block in route' /usr/local/rvm/gems/ruby-1.9.3-p448/gems/sinatra-1.0/lib/sinatra/base.rb:521: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’中

……

 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 ' /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. 我从项目目录中找到了一个目录,然后执行了以下操作
  2. gem install taps
  3. gem uninstall rack
  4. gem install rack --version 1.0.1

从项目目录启动sqlite服务器,在“one up directory”运行中:

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

然后像以前一样进行迁移并且它有效。 我安装了1.5.2机架,所以我不得不拆下它并用机架1.0.1替换它。 我正在使用ruby 2.0.0-p0和rails 4.0.0.beta1

似乎只有pull命令需要旧版本的机架,所以服务器可以运行在较新的1.5.2版本上……

@David Karlsson的回答也适用于我。 除非我必须在水龙头完成拉动后更新后架

 gem update rack 

并运行bundle install来恢复我所有的gem。

我在rails 3.2和ruby 1.9.3上

谢谢@DavidKarlsson,只需添加您的答案,就无需卸载现有机架。 根据@ hak8or在https://github.com/ricardochimal/taps/issues/128中的建议,我使用Gemfile来确保使用机架版本1.0.1。 但在我安装后,我有各种版本的机架

 $ 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 

并且不想卸载它们,因为这可能会影响我在同一台机器上的其他项目。 当我运行水龙头时,它将使用最新的机架1.5.2,所以我所做的是使用bundle exec运行水龙头,在我的情况下

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

希望能帮助到你!