我试图将我的rails SQLite数据库转换成Postgres数据库,最终部署到Heroku上。我一直在按照这里提供的指导对水龙头进行故障排除。
我成功地启动了taps服务器,但是当我拉动时出现了以下错误。
Receiving schema
Schema: 0% | ETA: --:--:--
Saving session to pull_201506052236.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: uninitialized constant Config
当我拉动时,输入“taps server”命令行项的控制台也会显示一个错误:
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
你能帮助我理解这个问题以及如何解决它吗?
请参阅下面两个控制台的完整日志
1)控制台“拉动”
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)控制台“taps server”
最初在命令“taps server”之后
== 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
一旦我在另一个控制台上运行“pull”
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
最佳答案
这是一个已知问题,并且有一个尚未合并的修补程序:
https://github.com/ricardochimal/taps/pull/144
https://github.com/ricardochimal/taps/pull/143
我有同样的问题,我认为这是因为我们都使用当前版本的Ruby(2.2.x)
关于ruby-on-rails - Taps Server错误:未初始化的常量配置(从SQLite迁移到Postgres),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30675765/