我正在尝试将我的rails SQLite数据库转换为Postgres数据库,最终部署在Heroku上。我一直在按照taps migration failing from sqlite to postgres rails4, ruby 1.9.3提供的指导进行故障排除。
我成功启动了点击服务器但是当我拉动时出现以下错误。
Receiving schema
Schema: 0% | ETA: --:--:--
Saving session to pull_201506052236.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: uninitialized constant Config
当我拉动时,我进入“点击服务器”的控制台'命令行项也显示错误:
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)控制台&#39;点击服务器&#39;
最初在命令后点击服务器&#39;
== 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
一旦我跑了&#39;拉&#39;在另一个控制台
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
答案 0 :(得分:0)
这是一个已知问题,还有一个尚未合并的补丁:
https://github.com/ricardochimal/taps/pull/144
https://github.com/ricardochimal/taps/pull/143
我有同样的问题,我认为这是因为我们都使用当前版本的Ruby(2.2.x)