welaika / wordmove

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

What's needed to run Wordmove on a clean install of Yosemite (Mac)? #126

Closed rob-teamworks closed 9 years ago

rob-teamworks commented 9 years ago

What things would need to be installed on a clean version of Yosemite (10.10.2) to be able to run Wordmove?

Does this work in conjunction with MAMP?

I'm new to all this but would love to get this working as it's exactly what we need.

alessandro-fazzi commented 9 years ago

:) Hi @rob-teamworks and thanks for enquiry :)

Wordmove completely ignores the web server (internally we don't use MAMP nor apache to develop WP sites). In order to run it you need just Ruby and it is shipped by default by Mac OS X.

All the remaining stack you need is just for running a WordPress installation and that is up to you and your flavours (at least for sure you'll have to install MySQL).

Do you need more info? Are your doubts most Wordpress related or ruby-world related?

rob-teamworks commented 9 years ago

@pioneerskies Hi, thanks for the reply.

I've tried it out and I can see it'll be great, I've hit one issue though. It seems to fail when trying to push the database, the rest works fine. This is probably because I'm trying to get the local database from the MAMP setup with the following in the Movefile:

local:
  vhost: "http://localhost:8888/Test"
  wordpress_path: "/Users/robjones/Desktop/Websites/Test" # use an absolute path here

  database:
    name: "test"
    user: "root"
    password: "root"
    host: "localhost"

This is the error it's giving me:

▬▬ ✓ Pushing Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
   remote | write /public_html/clients/test/wp-content/dump.php
    local | download http://www.teamworksdesign.com/clients/test/wp-content/dump.php?shared_key=050dcedc88e720423c32630977e23ba55a53565ca11f70031b0c2bfff4855f0df6f7a8dac6c15b98 > /Users/robjones/Desktop/Websites/Test/wp-content/remote-backup-1424855334.sql
   remote | delete: /public_html/clients/test/wp-content/dump.php
    local | mysqldump --host=localhost --user=root --password=root medaphor > /Users/robjones/Desktop/Websites/Test/wp-content/dump.sql
sh: mysqldump: command not found
/Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:147:in `run': Return code reports an error (RuntimeError)
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:210:in `save_local_db'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/deployer/ftp.rb:24:in `push_db'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/cli.rb:58:in `block in push'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/cli.rb:34:in `block in handle_options'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `each'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `handle_options'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/lib/wordmove/cli.rb:57:in `push'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/bin/wordmove:23:in `load'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/bin/wordmove:23:in `<main>'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `eval'
    from /Users/robjones/.rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in `<main>'

I'm specifically using this setup - http://zach-adams.com/2014/09/ultimate-wordpress-development-workflow/ but want to use MAMP as my local environment.

It's very close to working and is probably something I'm doing wrong.

alessandro-fazzi commented 9 years ago

I felt free to edit a bit your comment in order to improve legibility; hope you'll appreciate. I think we got it :) sh: mysqldump: command not found You have not mysql's executables in your path; and I think this is due to some tweeks needed in order to use MAMP, since it is installed isolated from the system...let's look a bit in deep...

+Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
$ sudo find /Applications -type f -name mysqldump

copy the resulting path and try to lunch it. I'm considering from now on that the right path for you is the first I've mentioned: /Applications/MAMP/Library/bin/mysql

$ echo '# Add MAMP bin directory into $PATH' >> ~/.bashrc
$ echo 'PATH="/Applications/MAMP/Library/bin:$PATH"' >> ~/.bashrc

Please let me know if it was useful as I hope ;)

Cheeers

rob-teamworks commented 9 years ago

@pioneerskies Ok great... sorry, wasn't sure how to sort that out but thanks.

I'll give this a go today, I can see the theory behind it. I'll get back to you shortly.

Thanks again.


Ok I gave it a go, did the following in Terminal:

Robs-iMac:~ robjones$ mysqldump
-bash: mysqldump: command not found
Robs-iMac:~ robjones$ /Applications/MAMP/Library/bin/mysqldump
Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
Robs-iMac:~ robjones$ echo '# Add MAMP bin directory into $PATH' >> ~/.bashrc
Robs-iMac:~ robjones$ echo 'PATH="/Applications/MAMP/Library/bin:$PATH"' >> ~/.bashrc
Robs-iMac:~ robjones$

Then closed it and reopened, then got this:

Robs-iMac:~ robjones$ mysqldump
-bash: mysqldump: command not found
Robs-iMac:~ robjones$
alessandro-fazzi commented 9 years ago

Ok, please, report here the contents of cat ~/.bash_profile, cat ~/.profile and tail -n 5 ~/.bashrc and at last echo $PATH. This way we should clarify why new instructions are not sourced.

rob-teamworks commented 9 years ago

@pioneerskies Thanks very much for this:

Robs-iMac:~ robjones$ cat ~/.bash_profile
export PATH=/opt/subversion/bin/:$PATH

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Robs-iMac:~ robjones$ cat ~/.profile

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Robs-iMac:~ robjones$ tail -n 5 ~/.bashrc
PATH="/Applications/MAMP/Library/bin:$PATH"
# Add MAMP bin directory into $PATH
PATH="/Applications/MAMP/Library/bin:$PATH"
# Add MAMP bin directory into $PATH
PATH="/Applications/MAMP/Library/bin:$PATH"
Robs-iMac:~ robjones$ echo $PATH
/Users/robjones/.rvm/gems/ruby-2.0.0-p598/bin:/Users/robjones/.rvm/gems/ruby-2.0.0-p598@global/bin:/Users/robjones/.rvm/rubies/ruby-2.0.0-p598/bin:/opt/subversion/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Users/robjones/.rvm/bin
alessandro-fazzi commented 9 years ago

Ok...first: in .bashrc you have doubled entries; please, remove those in excess.

Than try

$ echo 'source $HOME/.bashrc' >> ~/.bash_profile

restart your terminal and try to launch mysqldump.

I've also noticed you've RVM installed; since Wordmove is a gem it is installed probably inside an RVM's gemset and you are using an RVM's ruby, not the system one as per my first reply to your issue. This is just for clarification and correctness.

rob-teamworks commented 9 years ago

@pioneerskies That's great, thanks very much.

It outputs what I expected, I just need to tweak the mysql permissions on my staging server to push the database but all looks great.

alessandro-fazzi commented 9 years ago

Really really glad to hear those news! ^___^

Hope you'll enjoy.

Bye bye

eamaral92 commented 8 years ago

I have a similar problem, but mine is when the wordmove try to up the dump in the DB. The mysql command is working normally in terminal, but when i try to pull, wordmove keeping return this error:

local | adapt dump local | mysql --host=XXX --user=XXX --password=XXXX --database=XXXX --execute="SET autocommit=0;SOURCE /users/macweb02/Documents/projects/apaebarueri/wp-content/dump.sql;COMMIT" sh: mysql: command not found /Users/macweb02/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/wordmove-2.0.0/lib/wordmove/deployer/base.rb:132:inrun': Return code reports an error (Wordmove::ShellCommandError)`

I have try to change the ruby version and nothing changes... Can someone help me!!!

alessandro-fazzi commented 8 years ago

Sorry @eamaral92 , but this issue is old, closed and the original question is not inherent to your problem. Please, open an ad hoc issue and doing that read the contributor guide in the wiki in order to add some useful informations.

Cheers

alessandro-fazzi commented 8 years ago

Ok...just seen you have opened another issue here #330

michelmany commented 7 years ago

Hi @pioneerskies, I'm getting the same error: sh: mysqldump: command not found. Can you help me?

I'm using MAMP...

screen shot 2017-01-25 at 10 47 55
alessandro-fazzi commented 7 years ago

Hey @michelmany , su to have already read this one https://github.com/welaika/wordmove/wiki/MAMP-tips ?