Taps Server Error: Unified Config Constant (Moving from SQLite to Postgres)
I am trying to migrate a SQLite rails database to a Postgres database to eventually deploy to Heroku. I had some troubleshooting by following the instructions given here Disable the transition from sqlite to postgres rails4, ruby 1.9.3 .
I have successfully started the faucet server, but in doing so I get the following error.
Receiving schema
Schema: 0% | ETA: --:--:--
Saving session to pull_201506052236.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: uninitialized constant Config
When I pull out, the console where I entered the command line "taps server" also shows an error:
ERROR: NameError: uninitialized constant Config
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 - bastien [05/Jun/2015 22:36:35]
"POST /sessions/169975329 /pull/schema HTTP/1.1" 500 518 0.0039
localhost - - [05/Jun/2015:22:36:35 CEST]
"POST /sessions/169975329 /pull/schema HTTP/1.1" 500 518
- -> /sessions/169975329/pull/schema
Could you please help me understand this problem and how can I solve it?
See below for a complete log of both consoles.
1) "pull" console
Receiving schema
Schema: 0% | | ETA: --:--:--
Saving session to pull_201506052236.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: uninitialized constant Config
["/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/utils.rb:17:in `windows?'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/utils.rb:21:in `bin'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/utils.rb:132:in `schema_bin'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/server.rb:136:in `block in <class:Server>'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/deflater.rb:13:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/auth/basic.rb:25:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/commonlogger.rb:20:in `_call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/commonlogger.rb:13:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/content_length.rb:13:in `call'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in `service'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'", "/home/bastien/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'"]
2) Console 'taps server'
Initially after the 'taps server' command
== Sinatra/1.0 has taken the stage on 5000 for production with backup from WEBrick
[2015-06-05 22:36:28] INFO WEBrick 1.3.1
[2015-06-05 22:36:28] INFO ruby 2.2.2 (2015-04-13) [x86_64-linux]
[2015-06-05 22:36:28] INFO WEBrick::HTTPServer#start: pid=9396 port=5000
As soon as I run 'pull' in another console
127.0.0.1 - bastien [05/Jun/2015 22:36:34] "GET / HTTP/1.1" 200 25 0.0008
localhost - - [05/Jun/2015:22:36:34 CEST] "GET / HTTP/1.1" 200 25
- -> /
127.0.0.1 - bastien [05/Jun/2015 22:36:35] "POST /sessions HTTP/1.1" 200 39 0.1057
localhost - - [05/Jun/2015:22:36:34 CEST] "POST /sessions HTTP/1.1" 200 39
- -> /sessions
[...]
/pull/table_count HTTP/1.1" 200 21
- -> /sessions/169975329/pull/table_count
NameError - uninitialized constant Config:
/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24 /lib/taps/utils.rb:17:in `windows?'
/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/utils.rb:21:in `bin'
/home/bastien/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/taps-0.3.24/lib/taps/utils.rb:132:in `schema_bin'
[...]
ERROR: NameError: uninitialized constant Config
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 - bastien [05/Jun/2015 22:36:35] "POST /sessions/169975329/pull/schema HTTP/1.1" 500 518 0.0039
localhost - - [05/Jun/2015:22:36:35 CEST] "POST /sessions/169975329/pull/schema HTTP/1.1" 500 518
- -> /sessions/169975329/pull/schema
source to share
This is a known issue and there is a patch that has not been merged yet:
https://github.com/ricardochimal/taps/pull/144
https://github.com/ricardochimal/taps/pull/143
I have the same problem and I think it is because we are using current Ruby versions (2.2.x)
source to share