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

NameError: undefined local variable or method `deploy_to' for main:Object #475

Closed
pan-xiong opened this issue Nov 8, 2016 · 3 comments
Closed

Comments

@pan-xiong
Copy link

pan-xiong commented Nov 8, 2016

ruby 2.0
rails 3.2.21
mina 1.0.0

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'

set :term_mode, nil
set :rvm_path, '/usr/local/rvm/bin/rvm'

set :domain, 'domain_name'
set :deploy_to, 'app_path'
set :repository, 'github_path'
set :branch, 'master'

# Manually create these paths in shared/ (eg: shared/config/database.yml) in your server.
# They will be linked in the 'deploy:link_shared_paths' step.
set :shared_paths, ['config/database.yml', 'log', 'pids/unicorn.pid']

# Optional settings:
  set :user, 'deployer'    # Username in the server to SSH to.
#   set :port, '30000'     # SSH port number.

# This task is the environment that is loaded for most commands, such as
# `mina deploy` or `mina rake`.

task :environment do
  # If you're using rbenv, use this to load the rbenv environment.
  # Be sure to commit your .rbenv-version to your repository.
  # invoke :'rbenv:load'

  # For those using RVM, use this to load an RVM version@gemset.
  invoke :'rvm:use[ruby 2.1.1]' # the ruby version
end

# Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between
# all releases.
task :setup => :environment do
  queue! %[mkdir -p "#{deploy_to}/shared/log"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

  queue! %[mkdir -p "#{deploy_to}/shared/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

  queue! %[touch "#{deploy_to}/shared/config/database.yml"]

  queue  %[echo "-----> Be sure to edit 'shared/config/database.yml'."]

  queue! %[mkdir -p "#{deploy_to}/shared/pids"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/pids"]

  queue! %[touch "#{deploy_to}/shared/pids/unicorn.pid"]

end
@d4be4st
Copy link
Member

d4be4st commented Nov 8, 2016

You are using new mina with old script
https://github.com/mina-deploy/mina/blob/master/docs/migrating.md

@d4be4st d4be4st closed this as completed Nov 8, 2016
@alxx
Copy link

alxx commented Nov 17, 2016

I'm confused, deploy_to is still set, why is it undefined? Even with the new script conventions (some deprecation warnings would've been nice, before suddenly rendering us all unable to deploy our projects, don't you think?) the variable should still be readable, no?

@d4be4st
Copy link
Member

d4be4st commented Dec 13, 2016

No it is not.

The way it used to work was with method_missing. We wanted to get away from it.

We made a decision to not make mina 1.0 backwards compatible (that is the reason of the version bump as well)

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

3 participants