2013-08-13 7 views
5

Próbuję migrować moją aplikację Railsową do PostgreSQL dla heroku, ale nie mogę uzyskać stuknięć, aby uzyskać dane z mojej bazy danych SQLite3, oto, co próbowałem :migracja zaworów z sqlite do postgres rails4, ruby ​​1.9.3

Tworzenie bazy danych PostgreSQL użytkownika dla nowych baz

$ 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 - Aktualizacja komendy poniżej - użyj zamiast tego

$ createuser f3 -d -s 

Tworzenie wymaganych baz danych

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

zaktualizować Gemfile

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

Aktualizacja 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: 

Uruchom serwer dotknięć sqlite bazie

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

migracji danych

$ taps pull postgres://[email protected]/f3_development http://user:[email protected]:5000 

To daje błąd:

MacBook-Pro:devise_example-master david$ taps pull postgres://david:[email protected]/f3_development http://user:[email protected]:5000 
Receiving schema 
Unable to fetch tables information from http://user:[email protected]:5000. Please check the server log. 

ktoś dostał poprawkę na to, (I nie mogę po prostu przełączyć się na Ruby 1.9.2 używając rvm, ponieważ moja aplikacja używa wielu klejnotów, które nie działają dla starego rubinu).

A poniżej jest dziennik z serwera zawory sqlite kiedy przyciąganie jest wydawana

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:in uruchom ' /usr/local/rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb : 191: w 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/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 kodowanie ' /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/ perełki/sinatra-1,0/lib/sinatra/base.rb: 865 w 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 <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 

Odpowiedz

20

Ten pracował dla mnie:

  1. Podszedłem jeden katalog z mojego katalogu projektu następnie zrobił następującą
  2. gem install taps
  3. gem uninstall rack
  4. gem install rack --version 1.0.1

Uruchom serwer SQLite z katalogu projektu, w 'One Up katalogu' Run:

taps pull postgres://[email protected]/f3_development http://user:[email protected]:5000 

Potem zrobiłem migrację jak poprzednio i to działało. Miałem zainstalowany stojak 1.5.2, więc musiałem go usunąć i zastąpić go stelażem 1.0.1. Używam ruby ​​2.0.0-p0 i szyn 4.0.0.beta1

Wygląda na to, że tylko polecenie ściągnięcia wymagało starej wersji stelaża, aby serwer mógł działać na nowszej wersji 1.5.2 ...

+2

[źródło] (https://github.com/ricardochimal/taps/issues/128) –

+0

Miałem 2 różne wersje zainstalowanej szafy oprócz wersji 1.0.1. Musiałem je usunąć. – portforwardpodcast

+0

Musiałem również odinstalować wersję rack-1.6.4, a następnie uruchomić polecenie ściągania zaczepów, a następnie ponownie zainstalować rack-1.6.4. – Ryan

4

@David odpowiedź Karlsson pracował dla mnie też. Z wyjątkiem musiałem zaktualizować powrotem stojak raz krany zakończyła ciągnąć

gem update rack 

i uruchomić bundle install odzyskać wszystkie moje perełki pracy.

jestem na szynach 3.2 i Ruby 1.9.3

1

Dziękuję @DavidKarlsson, wystarczy dodać do swojej odpowiedzi, nie ma potrzeby odinstalowania istniejącego zębatkę. Zgodnie z zaleceniem @ hak8or w https://github.com/ricardochimal/taps/issues/128 użyłem Gemfile, aby zapewnić korzystanie z wersji rack 1.0.1. Ale po zainstalowaniu miałem różne wersje stelaża

$ 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 

i nie chciał ich odinstalować, bo to może mieć wpływ na inne projekty mam na tej samej maszynie. Kiedy uruchamiam krany byłoby używać najnowszej, stojak-1.5.2, więc co zrobiłem było uruchomić za pomocą wiązki krany exec, w moim przypadku

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

Nadzieję, że to pomaga!

Powiązane problemy