Im trying to start up Homestead 2.0 for a Laravel app however every time I run
homestead up
I get the output
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `expand_path': couldn't find HOME environment -- expanding `~' (ArgumentError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `expand_path'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/shared_helpers.rb:89:in `user_data_path'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/manager.rb:16:in `user_plugins_file'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.5/lib/vagrant/plugin/manager.rb:27:in `instance'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/lib/vagrant/pre-rubygems.rb:22:in `<main>'
What does couldn't find HOME environment -- expanding~' mean and how can I fix it? I'm using Oh-my-zsh as a shell.
Search your php.ini with this commands: php --ini
In your php.ini file, set variables_order = "EGPCS".
Thats it.
I'm having the same issue. As a work-around, you can add
ENV["HOME"] = "/Users/your-user-name"
to the file
/Applications/Vagrant/embedded/gems/gems/vagrant-*version*/lib/vagrant/shared_helpers.rb
right underneath require "tempfile" to get it up and running
You have to specify HOME environmental variable for your shell. Now your home dir is being found by checking ~ which always returns your default home dir i.e. cd ~ takes you to home dir.
The '~' shortcut in shell stands for the home folder for a user. For example, on OSX, if the user name is gael, the ~ is expanded (replaced) by the path which is /Users/gael.
For the second part of your question, may try to set HOME before launching it :
export HOME=/Users/gael
Regarding the answers by #michal.z & #gael
I had this problem and I am able to successfully
echo $HOME
which returns
/home/my-username
but I still got the error :-/
Anyway. I chose to follow #Adunahay s advice and I manually added the environment variable to the shared_helpers.rb file.
Related
I'm working in Windows 10 with a fresh installation of Anaconda and Git Bash. I decided to set cmd.exe as my default console program to use git bash (instead of the minTTY), and I think already I am getting issues with Unix style characters vs Windows.
When I fire up cmd Bash tells me it can't find my conda.sh file:
bash: C:UsersjoshuAnaconda3/etc/profile.d/conda.sh: No such file or directory
First, it looks like bash is missing the default windows slashes for my root directory ("C:/Users/joshu/"). Does anyone know how to fix this?
Thanks
I have the exact same problem. Run ~/.bashrc in a terminal. Go to the path given and correct the conda.sh path.
In your case, you will replace the C:\Users\joshu\Anaconda3/etc/profile.d/conda.sh to C:/Users/joshu/Anaconda3/etc/profile.d/conda.sh
Your only problem is that your slashes are set wrong.
Fix this issue by opening ~/.bashrc and change location of conda.sh, e.g. in my case
. D:/Users/my_user/ProgramFile/Continuum/anaconda3/etc/profile.d/conda.sh
Had the same problem on Windows 10/Git Bash/Anaconda installation. If you run ~/.bashrc in Git Bash, it should give you the location of the shell script file containing the incorrect path. Once you correct the path in that file, the message should disappear when you restart the terminal.
Another thing to check is make sure your user profile folder under C:\Users has not gone hidden. If it has gone hidden, then the C:\Anaconda\etc\profile.d\conda.sh script
won't be able to find the folder.
So I wanted to install MySQL on my MBP and I edited my bash_profile, added a path variable, however when I run echo $PATH from iTerm2 I get my path as:
Robs-MBP:~ Rob$ echo $PATH
/usr/local/mysql/bin
Ive tried a lot of commands and even used sudo and it just says command not found. My fear is that I have completely messed up, and now nothing works. Please help.
You've made a simple mistake: all you've done is reset the PATH env variable. To correctly do this, you should always add the existing PATH to the end of whatever you're adding. In you case:
PATH=/usr/local/mysql/bin:$PATH
To fix your problem from the terminal, you'll need to reset your PATH to somewhere with a text editor. I don't know where this is located on OSX, so you'll have to find it. After you know where your path should point, run:
$ export PATH=<YOUR_PATH_HERE>
Then edit your bashrc to include the original path as described above, and restart the terminal.
Alternatively, open .bashrc with a GUI text editor and make the change from there. Your PATH decleration should always end in :$PATH to include the PATH created by your system.
I'm learning Laravel and found this direction on their documentation:
"Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable is found when you run the laravel command in your terminal." http://laravel.com/docs/4.2/installation#install-laravel
Question:
How exactly I make sure the folder is on my PATH? What's the command?
If I'm not on the PATH, how to get there? I tried to find /.composer/vendor/bin but got nothing.
I'm using Windows 8 64bit.
1) windows: PATH | grep -oP ".composer.*bin"
If it's in the path You'll get a response if it's not you'll get nothing.
2)
~/ refers to home path on linux doing %HOMEPATH% on windows results in the same thing, which in your case would be %HOMEPATH%/.composer/vendor/bin
Doing /somefolder Will go to the root path in linux and try to find a folder there called somefolder but won't do anything in windows, I'm not sure what the equivalent in windows is, might be referring to root of the drive, I.e. C:\ or D:\ etc.
To add .composer/vendor/bin to your home path you need to go to your environmental variables and add it into the path you can go here and follow the steps in the answer or the question.
The important bit:
Example of windows SETX command:
Print the PATH environment variable:
C:\Users\Charity>echo %PATH% C:\windows\system32;C:\windows and
space;C:\foobar Use setx to set the environment variable:
C:\Users\Charity>setx PATH "%PATH%;C:\zombiepoke" SUCCESS: Specified
value was saved. Close and re-open cmd terminal, then run:
C:\Users\Charity>echo %PATH% C:\windows\system32;C:\windows and
space;C:\foobar;C:\zombiepoke You have to be careful with double
quotes. If you let quotes get into your path variable it might break
something. However they are necessary for specifying addendums to the
original %PATH%.
Make note though that this only sets it for the current user context, to set it for all users you have to to use setx /M.
for those who also needs the answer for this question, I found it here.
Basically, all you need is to write:
cd %APPDATA%\Composer\vendor\bin
I installed Sencha SDK and Sencha command on my mac-mini and done with some sample app.. but suddenly after some time when I tried to run sencha command on terminal, I got the response as '-bash: sencha command not found', I don't know why this was happened. Earlier I didn't find such type of response but now I got this error. Please tell me what are the possible scenarios for this thing to be happened.. Thanks for your help
Alens-Mac-mini:touch-2.2.0 SenchaTools$ sencha
-bash: sencha: command not found
You should procede that way:
Verify if this command is contained in PATH. PATH is an environment variable holded by bash and initialized when a new user is logged in (.bash_profile file for all user and the corrispective into home for single user). So check what echo $PATH told you and verify if this command is contained into those folder
Probably, from step 1, the answer will be "No, it isn't". So you have to procede this way: use whereis command to search this command (that will be an executable script) and once you find it, you have two possibilities: one is to use it directly by specifying full path (returned from whereis command).
If you want to run simply it with sencha -arguments you have to add executable path returned by whereis ($PATH=$PATH:/returned/path/by/whereis) into file .bash_profile
In that way you should be able to execute your command from any "point" in your filesystem
The Sencha installer expects you to use bash as shell. It fails, if you use any other (like the nice zsh). You need to copy the content of .bash_profile to your shell startup-file (.zprofile in my case), save it and open a new terminal window.
Add PATH and VAR manually in .bash_profile file at the root of your user folder,
export SENCHA_CMD_3_0_0="/Users/you/Path/To/Sencha/Cmd/3.0.0.XXX"
export PATH=/Users/you/Path/To/Sencha/Cmd/3.0.0.188:$PATH
Find out more about this issue at sencha forum https://www.sencha.com/forum/showthread.php?245243-Command-not-found-mac-OSX-mountain-lion
I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable.
Later I deleted the sencha sdk tools folder but didn't realize that the path variable is still there.
When i did echo $PATH I got -
/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
I searched on how to remove variables from $PATH and followed these steps :
Gave the command PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"
Did echo $PATH which showed /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
gave the command export PATH
Closed terminal and reopened it. Gave the command echo $PATH. This time I got
/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
Can anyone tell me what am i doing wrong?
echo $PATH and copy it's value
export PATH=""
export PATH="/path/you/want/to/keep"
Check the following files:
/etc/bashrc
/etc/profile
~/.bashrc
~/.bash_profile
~/.profile
~/.MacOSX/environment.plist
Some of these files may not exist, but they're the most likely ones to contain $PATH definitions.
On MAC OS X Leopard and higher
cd /etc/paths.d
There may be a text file in the above directory that contains the path you are trying to remove.
vim textfile //check and see what is in it when you are done looking type :q
//:q just quits, no saves
If its the one you want to remove do this
rm textfile //remove it, delete it
Here is a link to a site that has more info on it, even though it illustrates 'adding' the path. However, you may gain some insight.
What you're doing is valid for the current session (limited to the terminal that you're working in). You need to persist those changes. Consider adding commands in steps 1-3 above to your ${HOME}/.bashrc.
If you're removing the path for Python 3 specifically, I found it in ~/.zprofile and ~/.zshrc.
$PATH contains data that is referenced from actual files. Ergo, you should find the file containing the reference you want to delete, and then delete said reference.
Here is a good list to run through progressively [copied from #Ansgar's answer with minor updates].
/etc/bashrc
/etc/profile
~/.bashrc
~/.bash_profile
~/.profile
~/.MacOSX/environment.plist
/etc/paths
/etc/paths.d/
Note that /etc/paths.d/ is a directory that contains files with path references. For example, inside this directory may be a file called, say, fancy-app, and inside this file you'll see an entry like below:
/path/to/fancy-app
This path will appear in your $PATH and you can delete the entry in the file to remove it, or you can delete the file if it has only the one reference you want to remove.
Use sudo pico /etc/paths inside the terminal window and change the entries to the one you want to remove, then open a new terminal session.
when you login, or start a bash shell, environment variables are loaded/configured according to .bashrc, or .bash_profile. Whatever export you are doing, it's valid only for current session. so export PATH=/Applications/SenchaSDKTools-2.0.0-beta3:$PATH this command is getting executed each time you are opening a shell, you can override it, but again that's for the current session only. edit the .bashrc file to suite your need. If it's saying permission denied, perhaps the file is write-protected, a link to some other file (many organisations keep a master .bashrc file and gives each user a link of it to their home dir, you can copy the file instead of link and the start adding content to it)
Close the terminal(End the current session). Open it again.
If the manual export $PATH method does not seem to be working after you close the terminal and open again, definitely check the shell configuration files.
I found a small script that kept adding some more path in front of the $PATH everytime it was open.
For zsh you can check the ~/.zshrc file.