Vagrant配置Ubuntu17.10安装Bonobo后执行bonobo version失败求助排查
Hey there! Let's walk through the most common culprits that cause Bonobo to seem like it installed fine during vagrant provision, but throw errors when you run bonobo version over SSH:
PATH/Environment Variable Mismatch
Vagrant runs provisioning scripts as therootuser by default (unless you explicitly setprivileged: falsein your Vagrantfile). When you SSH into the VM, you're almost certainly using the regularvagrantuser. If your install script added Bonobo's directory to only root's PATH, or installed it in a location that's not accessible to the vagrant user's PATH, the shell won't find thebonobocommand.
To check this: Runecho $PATHin your SSH session, then runsudo echo $PATHto compare root's PATH. Look for the directory where Bonobo was installed—if it's missing from the regular user's PATH, that's your issue.Shell Configuration Not Reloaded
If your provision script modified a shell config file (like~/.bashrc,~/.profile, or/etc/profile) to update the PATH, those changes don't apply to already running SSH sessions. The provision script runs in a non-interactive shell, so it doesn't trigger a reload automatically.
Fix this quickly by either logging out and back into SSH, or runningsource ~/.bashrc(or the appropriate config file for your shell) in your current session.Silent Installation Errors
Just becausevagrant provisionoutputs "everything looks normal" doesn't mean there weren't hidden failures. Maybe a dependency failed to install, the Bonobo download was corrupted, or your script didn't check exit codes for critical commands (so it kept running even if a step failed).
Try re-running the key parts of your install script manually (as root) in the SSH session—like the commands to install dependencies, download Bonobo, or run the installer. You might catch errors that were swallowed during provisioning.File Permission Issues
If Bonobo's binary files or supporting libraries were installed with permissions that only allow root to execute them, the regular vagrant user will get a "permission denied" error (or the shell might act like the command doesn't exist entirely).
Find where Bonobo is installed withsudo find / -name bonobo, then check permissions withls -l <path-to-bonobo-binary>. Make sure the file has at leastr-xpermissions for all users (e.g.,chmod +x <path>if needed).
内容的提问来源于stack exchange,提问作者mrc

