thoughtbot / laptop

A shell script to set up a macOS laptop for web and mobile development.
https://thoughtbot.com
MIT License
8.5k stars 1.91k forks source link

Failed to install postgresql and redis #469

Closed mbigras closed 8 years ago

mbigras commented 8 years ago

Hello!

I'm experimenting with laptop in a vagrant box. I have two failures, please see below:

vagrant@This-MacBook-Pro:~ % cat laptop.log

Updating Homebrew formulae ...
Already up-to-date.
Succeeded in tapping thoughtbot/formulae
Succeeded in tapping homebrew/services
Succeeded in installing ctags
Succeeded in installing git
Succeeded in installing openssl
Succeeded in installing rcm
Succeeded in installing reattach-to-user-namespace
Succeeded in installing the_silver_searcher
Succeeded in installing tmux
Succeeded in installing vim
Succeeded in installing zsh
Succeeded in installing heroku-toolbelt
Succeeded in installing parity
Succeeded in installing hub
Succeeded in installing imagemagick
Succeeded in installing qt
Succeeded in installing libyaml
Succeeded in installing node
Succeeded in installing rbenv
Succeeded in installing ruby-build
Could not find domain for
Error: Failure while executing: /bin/launchctl load -w /Users/vagrant/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Failed in installing postgres
Could not find domain for
Error: Failure while executing: /bin/launchctl load -w /Users/vagrant/Library/LaunchAgents/homebrew.mxcl.redis.plist
Failed in installing redis

Success: 20 Fail: 2
failed

Also, please see my Vagrantfile below:

➜  osx cat Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "jhcook/osx-elcapitan-10.11"

  # private network setup
  # config.vm.network "private_network", type: "dhcp"
  config.vm.network :private_network, ip: "192.168.10.2"
  # enable NFS
  config.vm.synced_folder ".", "/vagrant", type: "nfs"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end

  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

It seems different than #461, because it doesn't look like I'm having a problem with permissions but instead it has something to do with /bin/launchctl. Looking at #260 mentions:

The fix would probably be to check launchctl list to see if the service is already loaded before calling launchctl unload.

I'm not really sure what I should be looking for but this is the output from launchctl list

vagrant@This-MacBook-Pro:~ % launchctl list
PID Status  Label
-   0   com.apple.trustd.agent
-   0   com.apple.mdworker.mail
424 0   com.apple.cfprefsd.xpc.agent
-   0   com.apple.spotlight.IndexAgent
-   0   com.apple.mdworker.bundles
-   0   com.apple.secinitd
-   0   com.apple.cvmsCompAgent3600_i386_1
-   0   com.apple.cvmsCompAgentLegacy_i386
1021    0   com.apple.tccd
-   0   com.apple.cvmsCompAgent3600_x86_64_1
-   0   com.apple.netauth.user.auth
-   0   com.apple.mbbackgrounduseragent
-   0   com.apple.cvmsCompAgent_x86_64
-   0   com.apple.pluginkit.pkd
-   0   com.apple.cvmsCompAgentLegacy_x86_64
-   0   com.apple.security.cloudkeychainproxy3
-   0   com.apple.metadata.mdflagwriter
-   0   com.apple.speech.speechsynthesisd
-   0   com.apple.mdworker.shared
-   0   com.apple.mdworker.isolation
-   0   com.apple.installandsetup.migrationhelper.user
-   0   com.apple.TrustEvaluationAgent
-   0   com.apple.FileSyncAgent.PHD
-   0   com.apple.mdworker.32bit
-   0   com.apple.secd
-   0   com.apple.cvmsCompAgent_x86_64_1
-   0   com.apple.cvmsCompAgent_i386_1
-   0   com.apple.cvmsCompAgentLegacy_i386_1
-   0   com.apple.cvmsCompAgent3600_i386
-   0   com.apple.mdworker.lsb
-   0   com.apple.storeinstallagent
-   0   com.apple.mdworker.single
-   0   com.apple.cvmsCompAgentLegacy_x86_64_1
-   0   com.apple.syncdefaultsd
-   0   com.apple.mdworker.sizing
-   0   com.apple.metadata.mdbulkimport
1278    0   com.apple.mdworker.shared.01000000-0000-0000-0000-000000000000
-   0   com.apple.cvmsCompAgent3600_x86_64
1365    0   com.apple.distnoted.xpc.agent
-   0   com.apple.cvmsCompAgent_i386

Also manually running launchctl confirms that there is something going on with the domain:

vagrant@This-MacBook-Pro:~ % launchctl load  /Users/vagrant/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Could not find domain for

Would love some help and guidance on how to sort these two out.

Also I'd like to keep discussing laptop and dotfiles on Upcase as I'm sure I'll have more questions, but it doesn't seem like there is an appropriate category. I was expecting to find a zsh, dotfiles or configuration management category but it doesn't look like it's there. What would you recommended?

Thanks for your help 😄

mbigras commented 8 years ago

The solution was to get in through VirtualBox instead of only sshing in, see this stack overflow post for more details, looking forward to learning more about this project 👍 👍