データベース移行時(wordmove pull -d する際)に出るエラー

moritani 217views 更新:2015年11月10日

wordmove pull -dで以下のエラーがでたら、

/usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb:44:in `gsub!': invalid byte sequence in US-ASCII (ArgumentError)
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb:44:in `serialized_replace!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb:36:in `replace_field!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb:25:in `replace_vhost!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb:17:in `adapt!'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/deployer/base.rb:177:in `adapt_sql'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/deployer/ssh.rb:38:in `pull_db'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/cli.rb:59:in `block in pull'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/cli.rb:36:in `block in handle_options'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/cli.rb:35:in `each'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/cli.rb:35:in `handle_options'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/cli.rb:58:in `pull'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/exe/wordmove:6:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/wordmove:23:in `load'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/wordmove:23:in `<main>'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

$ sudo vi /usr/local/rvm/gems/ruby-2.2.1/gems/wordmove-1.4.0.pre4/lib/wordmove/sql_adapter.rb でファイルを開き、44行目の上に以下のコードを追記します

sql_content.force_encoding("UTF-8”)

参考URL https://github.com/welaika/wordmove/issues/78

ログイン / 新規登録してコメントする

このソースコードをストックして後で利用したり、作業に利用したソースコードをまとめることができます。

こちらもお役に立つかもしれません