Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method "deploy_method" #115

Open
adityapingle opened this issue Jan 11, 2016 · 7 comments
Open

undefined method "deploy_method" #115

adityapingle opened this issue Jan 11, 2016 · 7 comments

Comments

@adityapingle
Copy link

hello,

while trying to include the deploy block as suggested in this repo, i get the following error when i try to execute middleman server or middleman build.

/home/aditya/development/slate/slate/config.rb:35:in `block in initialize': undefined method`deploy_method=' for #Middleman::Deploy::Options:0x007fbfaf4beee0 (NoMethodError)

ruby versions tried:
1.9.3 (had to upgrade as net-ssh requires >=2.0.0)
2.0.0
2.3.0

executing middleman:
middleman server (while on 1.9.3)
bundle exec middleman s

what additional information I might need to provide?

@kirichkov
Copy link

Change the line in your Gemfile to:

gem 'middleman-deploy', github: 'middleman-contrib/middleman-deploy', branch: 'master'

You need to use the latest version, because of changes in the middleman v4.0.0 API. Your other option is to downgrade middleman-core to v3

@egardner
Copy link

I think I'm seeing a related issue – I've added the latest version to my gemfile as above, but when running bundle exec middleman deploy I get an error message stating Setting method doesn't exist (Runtime Error). I'm using Ruby 2.2.2 and Middleman v4, and using a standard github-pages deploy setup which has worked on v3 sites.

@rriemann
Copy link

I can confirm this issue. Ruby 2.2.1, middleman-core-4.1.1 here.

@mbyio
Copy link

mbyio commented Mar 7, 2016

I also encountered this issue until I saw @kirichkov 's instructions. Please consider updating the README.

@glennpjones
Copy link

Encountered same problem and @kirichkov's comment solved it for me. Had to specify git instead of github.

gem 'middleman-deploy', git: 'https://github.com/middleman-contrib/middleman-deploy', branch: 'master'

@legal90
Copy link

legal90 commented Apr 8, 2016

I can confirm this too. However, solutions above doesn't help. The trace is:

$ bundle exec middleman deploy -b
/Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/bundler/gems/middleman-deploy-243ab38b0889/lib/middleman-deploy/commands.rb:94:in `deploy_options': undefined method `deploy_method' for nil:NilClass (NoMethodError)
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/bundler/gems/middleman-deploy-243ab38b0889/lib/middleman-deploy/commands.rb:64:in `build_before'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/bundler/gems/middleman-deploy-243ab38b0889/lib/middleman-deploy/commands.rb:57:in `deploy'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:40:in `block in register'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/legal/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/middleman-cli-4.1.6/bin/middleman:67:in `<top (required)>'
    from /Users/legal/.rbenv/versions/2.1.0/bin/middleman:23:in `load'
    from /Users/legal/.rbenv/versions/2.1.0/bin/middleman:23:in `<main>'

@bryansray
Copy link

bryansray commented Aug 11, 2016

It would seem that simply changing your deploy.method to deploy.deploy_method will fix this problem.

I believe that commit 9eece01 is responsible for the change. Not entirely sure why the change though? Seems like it may have been a typo.

activate :deploy do |deploy|
  deploy.deploy_method = :rsync
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants