Unable to install modman, .profile is missing - bash

https://github.com/colinmollenhour/modman/blob/master/README.md
I am trying to install modman.
First I install via:
bash < <(curl -s -L https://raw.github.com/colinmollenhour/modman/master/modman-installer)
modman is created at User/Username/bin/modman
I got lost on the next part:
source ~/.profile
I don't have .profile in my directory, so i created one in my user root and I added
export PATH=$PATH:/Users/Username/bin/modman
I am not sure if that is correct, when I cd to my project directory and
do modman init it returns modman: command not found
Why am I getting this message?

You add directories to PATH, not individual binaries.
export PATH=$PATH:/Users/Username/bin
Note the line from the installer that would have updated .profile for you:
echo -e '\nPATH="$HOME/bin:$PATH"' >> $HOME/.profile
(Typically, you might add $HOME/bin to the beginning of the path so that you can override system binaries, but in your case, it doesn't matter since you don't have modman installed outside your home directory.)

Related

Did I mess up my PATH? .bash_profile

I am trying to open up files from my terminal using atom. Which resulted in -bash: atom: command not found. I then followed, installing the shell commands from the editor. That resulted in "EEXIST: file already exists, mkdir '/usr/local/bin'" . I've previously tried to follow other recommendations on how to add the subl alias and I guess I tried way too many things, that I didn't understand. Could I have messed up my $PATH ?
When I echo my path this is what it is /bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin.
My bash_profile looks like this when I opened it with nano:
export PATH=/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH
export EDITOR='subl -w'
I don't remember if I added that first line when I tried adding subl.
Should I remove that? I'm also using a MacOS High Sierra.
UPDATE
I removed what I had previously added in my .bash_profile and my path is now: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin.
I then ran the command: sudo ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh /usr/local/bin/atom but got a ln: /usr/local/bin/atom: No such file or directory error
You can remove the export PATH statement from your .bash_profile; it doesn't add anything that isn't already there. (Except maybe /usr/local/sbin, but I would remove that until you can demonstrate a need for it.)
Initially, PATH will include the directories listed in /etc/path:
% cat /etc/paths
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
Any of your shell configuration files can add to the PATH. Assuming you haven't significantly altered your configuration, /etc/profile will run path_helper to add any directories listed in files under /etc/paths.d.
You only need to update PATH if you need to add a directory that is not already there. If atom is located in one of the above paths, you don't need to do anything. It sounds like you attempted to create /usr/local/bin when it already (as it should) exists, then perhaps did not ultimately create the symlink for atom under /usr/local/bin.
Try running just the ln command from the question you linked (using sudo if necessary), then confirm that /usr/local/bin/atom does indeed exist.

Laravel Spark Installation in MAC

I'm new to mac and I don't know how to add path to the system. I have already cloned the file for spark and done composer update. I need to this next step. How do I do it in MAC?
Next, make sure the spark-installer directory is added to your systems $PATH variable, so that your machine will be able to locate the spark executable when you issue Spark commands.
You do it by updating the PATH variable.
export PATH=$HOME/.composer/vendor/bin:$PATH
However, this will not persist. If you close the terminal window, the PATH will be restored to its original value. You need to add this line to your ~/.bash_profile
Run this command to add the line to your ~/bash_profile
echo 'export PATH=$HOME/.composer/vendor/bin:$PATH' >> ~/.bash_profile
To verify that you have the correct path: echo $PATH, and you should see .composer/vendor/bin in the middle of the output
For spark specifically, you need to add the path to the location where you cloned the repo.
echo 'export PATH=path/to/spark/repo:$PATH' >> ~/.bash_profile
Here is a full list of commands to install Spark:
cd $HOME
git clone https://github.com/laravel/spark-installer.git
echo 'export PATH=$HOME/spark-installer:$PATH' >> ~/.bash_profile
source ~/.bash_profile
cd ~/spark-installer
composer install
spark

Create symlink to other paths from babun home directory

I just installed babun on my Windows 7.
babun's ~/home/xxx is located at C:\Users\Admin\.babun\cygwin\home\xxx on windows file system.
xxx is my user name on windows
Let's say my worked files are stored in D:\work, how can I create symlink to link to D:\work?, so I can easily use cd mysymlink to change the working directory from babun's home directory.
Please help.
Thanks.
Try to create a link in / like this:
ln -s /cygdrive/d/work /myworkdir
Then you should be able to cd /myworkdir to your disired directory.
Another option would be to create an alias in your .bashrc:
echo "alias gtw=\"cd /cygdrive/d/work\"" >> ~/.bashrc
After that you could simply write gtw.
Note: gtw means go to work :) but you can choose whatever you like...
Edit: Oh, sorry you added the zsh tag, I didnt see then the second option must be like this:
echo "alias gtw=\"cd /cygdrive/d/work\"" >> ~/.zshrc

How to set path to ruby on win 7

I am using git-bash in win7. I have installed c:/ruby/bin/ruby.exe. I've added c:/ruby/bin/ to my PATH environmental variable and restarted. however when I do:
$ which ruby
/c/opscode/chef/embedded/bin/ruby
$ echo $PATH
/c/ruby/bin:/c/st:/c/Users/Bill/bin:.:/usr/local/bin:/mingw/bin:/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/c/Program Files (x86)/QuickTime/QTSystem:/c/python27:/c/Python27/Lib/sitepackages/django/bin:/c/Python27/Scripts:/c/MinGW/bin:/d/opscode/chef/bin:/d/opscode/chef/embedded/bin:/d/VirtualBox/VBoxManage:/d/HashiCorp/Vagrant/bin:/c/opscode/chef/bin:/c/opscode/chef/embedded/bin:/c/ProgramData/Composer/bin:/c/Program Files (x86)/git/cmd:/c/nodejs/:/c/Users/Bill/AppData/Roaming/npm:/c/Ruby193/bin
How do I change this to "c:/ruby/bin/" ?
Add following line to /c/Users/your-username/.bashrc file to make the /c/ruby/bin placed before any other directory in the PATH:
export PATH=/c/ruby/bin:$PATH
Or, start git bash, and issue the following command:
echo 'export PATH=/c/ruby/bin:$PATH' >> ~/.bashrc
UPDATE
If above still does not work, check whether the directory /c/ruby does exists. If it does, check whethere ruby.exe file is in the directory /c/ruby/bin.
If the directory does not exist, replace /c/ruby/... with the one really exists.

Cannot get subl command working for ST3 on OSX

I am trying to get the Subl command working on my Mac OSX Mavericks. I have ST3 in my root applications folder.
When I run the line below, I also run it with sudo and get the same message.
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
In the terminal I get the following error
ln: /Users/username/bin/subl: No such file or directory
I double checked to see if it was working or not with
subl --help
but get the following error
-bash: subl: command not found
I am trying to get this to work so I can use it with Git and open file with sublime from there https://help.github.com/articles/associating-text-editors-with-git#using-sublime-text-as-your-editor
My .bash_profile looks like the following
export PATH=/usr/local/git/bin:$PATH
export PATH="/usr/local/bin:$PATH"
export EDITOR='subl -w'
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
Can anyone advise how to fix this problem,
Thanks
Most likely the issue is that you don't have a /Users/username/bin directory in the first place, so your ln command trying to create a symlink isn't working. Secondary to that, even if ~/bin did exist, it's not part of your PATH, so the subl command won't ever be found.
To make things much easier for you, just create the symlink in /usr/local/bin. It (hopefully) already exists, and is already in your PATH. Just run
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
and you should be all set.
In response to your comment: There are 2 commands here - ln, which creates a symlink, and export, which just creates an environment variable (PATH is a special environment variable that contains the list of directories searched for commands when you enter something in Terminal).
When you create a symlink, the entire directory tree needs to exist before the link will be created. So, while /Users and /Users/username already existed, /Users/username/bin did not, so the ln command failed, regardless of whether sudo was used. In order to create the bin directory in your home directory (also known as ~), you would first have needed to run mkdir ~/bin, then create the symlink with your first ln command (the one without the sudo). Next, you would have needed to add ~/bin to your PATH environment variable by replacing the first two lines in ~/.bash_profile with
export PATH=~/bin:/usr/local/bin:/usr/local/git/bin:$PATH
However, since /usr/local/bin was already in your PATH, the easiest solution was to create the symlink to subl there, instead of creating a new ~/bin directory, making the symlink, editing ~/.bash_profile, then restarting your shell.
I also have this requirement. I use alias instead of those symbolic link method. It is rather easy and here is how.
Step1: Open ~/.bash_profile, add below line into it then save and close it.
alias subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'
Step2: execute source to make the alias setting take effect.
source ~/.bash_profile
Now you can use command subl following by a file or directory path to open them, enjoy!

Resources