welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 165 forks source link

undefined method `[]' for nil:NilClass (NoMethodError) #401

Closed dwinnbrown closed 7 years ago

dwinnbrown commented 7 years ago

Hi There,

I have used Wordmove before flawlessly on a different machine however am having issues with it no and am getting the following error:

/Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/wordmove-2.1.2/lib/wordmove/deployer/base.rb:24:in `deployer_for': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/wordmove-2.1.2/lib/wordmove/cli.rb:80:in `push'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/base.rb:444:in `start'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/gems/wordmove-2.1.2/exe/wordmove:6:in `<top (required)>'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/bin/wordmove:23:in `load'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/bin/wordmove:23:in `<main>'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
    from /Users/dwinnbrown/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'

Any idea what could be causing it? My move file is correctly indented and validates fine.

See below:


local:
    vhost: "http://domain.dev"
    wordpress_path: "/Users/username/Sites/path/"

    database:
        name: "name"
        user: "user"
        password: "password"
        host: "host"
        port: "port"

staging:
    vhost: "http://domain.com"
    wordpress_path: "/var/sites/path_to/public_html/"

    exclude:
        - ".git/"
        - ".gitignore"
        - ".sass-cache/"
        - "node_modules/"
        - "bin/"
        - "tmp/*"
        - "Gemfile*"
        - "Movefile"
        - "wp-config.php"
        - "wp-content/*.sql"

    database:
        name: "name"
        user: "user"
        password: "password"
        host: "host"

    ssh:
        host: "host"
        user: "user"
        password: "pass"```
alessandro-fazzi commented 7 years ago

This is latest version with an old Movefile. When you have installed you should have seen a disclaimer saying to update the Movefile with the new "global" section.

If you'll do a fresh 'wordmove init' and reconfigure the Movefile, it will be fixed.

In the wiki you can find updated documentation.

😊