I tried this
Muhammeds-MacBook-Pro:first_app muhammedz786$ subl Gemfile
-bash: subl: command not found
Why is this happening?
I also tried this
Muhammeds-MacBook-Pro:first_app muhammedz786$ subl ~/.gemrc
-bash: subl: command not found
Please help
Run the following command from Terminal:
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/bin/subl
and you should be able to use the subl command. If you are using Sublime Text 3, the command is
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
Related
Hung up on editing the .bash_profile while running rbenv init on mac.
$ rbenv init
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
but get the message:
-bash: /Users/macbookpro/.bash_profile: Permission denied
I try to edit the .bash_profile directly but get the message:
I found this command to see the users:
$ ls -la ~ | grep bash
It shows:
-rw------- 1 macbookpro .bash_history
-rw-r--r-- 1 root .bash_profile
If I open the file using command:
$ sudo nano ~/.bash_profile
I guess I need to add this to .bash_profile:
$ export PATH="$HOME/.rbenv/bin:$PATH"
Or is it just the inner "part" of this?
Also how do I save this or do we have any easier solution (pretending my name is Fname-Lname)?
You'll need to use sudo in order to edit/append ~/.bash_profile on macOS.
sudo echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
Or just as you had done at the end of your question.
I was having the same issue what i did was i gave .bash_profile writable permission.
cd ~
sudo chmod 0777 .bash_profile
nano .bash_profile
After adding your modifcations you can now save the file with ^O and enter (return) after that you use ^x to exit.
Note: ^ is the control button
How can I (re)enable command line support for Sublime Text under Mac OS X El Capitan ?
To add command line support for Sublime text under Mac OS X El Capitan, open the Terminal.app and run the following command :
sudo mkdir -p "/usr/local/bin/" && ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Edit:
In case you already have the directory /usr/local/bin/ on your system, just run the second part of the command (after the &&) :
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
In case of Sublime Text 3:
sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
The answer from Telmo Bias is quite correct but didn't work.
In my case, i use Sublime Text 2, and here the command :
sudo mkdir -p "/usr/local/bin/" && sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Close and reopen the terminal, you should be good to go.
I just tried it before writing this.
You should be able to use subl or sublime from the console to open a file on the system like /etc/abc.conf.
I'm trying to get Sublime Text 2 to work on command line. Since I upgraded to Mavericks I haven't had any luck.
$ echo $PATH
/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
$ ls -l /usr/local/bin/subl
lrwxr-xr-x 1 root wheel 62 Mar 13 13:38 /usr/local/bin/subl -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
$ subl htdocs/index.html
-bash: subl: command not found
sI cannot make alias 'sublime' to work suing
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
I checked path:
/Applications/Sublime Text.app/Contents/SharedSupport/bin/
$ls- la
total 0
drwxr-xr-x 2 ks admin 68 Jan 19 11:22 .
drwxr-xr-x 3 ks admin 102 Dec 16 21:25 ..
This is what I tired to do:
open file using subl
$ cd subl
-bash: cd: subl: No such file or directory
$ open subl
The file /Applications/Sublime
Text.app/Contents/SharedSupport/bin/subl does not exist.
$ subl --help
-bash: subl: command not found
If it is still isn't working after you created the symlink, the file might be quarantined. To check, open a terminal and get yourself to the directory that subl is in. Once you are there, check the extended permissions by typing:
xatt subl
If you see com.apple.quarantine, your file is quarantined. To remove the quarantine do ...
xattr -d com.apple.quarantine my_jar.jar
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Should do the trick. See this post for additional info Sublime Text 3 and Terminal prompt for OS X Mavericks?
few small things you can try
sudomkdir /usr/local
sudomkdir /usr/local/bin
sudo ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sub
remember to change the sublime text version to that which you have installed ( I recommend 2/3, not the first one)
Usage in Terminal:
(for directory you're currently in) subl .
(any other directory) subl ~/Documents/example.txt
Try:
mkdir /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
I have installed
Xcode 5
Command line tools
gcc with homebrew
But when I try to use gcc command it says:
-bash: gcc: command not found
The location
gcc -version -bash: gcc: command not found
bolo:~ Michelin$ ls /usr/bin/gcc-4.2 /usr/bin/gcc-4.
http://cl.ly/image/3m2U1N0q1B2l
update
bolo:~ Michelin$ xcode-select -p
Usage: xcode-select -print-path
or: xcode-select -switch <xcode_folder_path>
or: xcode-select -version
Arguments:
-print-path Prints the path of the current Xcode folder
-switch <xcode_folder_path> Sets the path for the current Xcode folder
-version Prints xcode-select version information
bolo:~ Michelin$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
and
bolo:~ Michelin$ locate */bin/gcc
/Applications/Xcode.app/Contents/Developer/usr/bin/gcc
/Library/Developer/CommandLineTools/usr/bin/gcc
bolo:~ Michelin$
update (12:18pm)
on my system
bolo:~ Michelin$ ls /usr/local/bin/gc
gcc-4.2 gcov-4.2
My bash_profile
export PATH=/usr/local/bin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
source ~/.rvm/scripts/rvm
and after.
bolo:~ Michelin$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/Michelin/.rvm/bin
Thanks
Ok probleme solved. I have replaced my bin folder by other one and now every works.
Maverick is not came with .bash_profile. Need to change bash_profile using vim or nano command.
Edit with following...
# Set architecture flags
export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
export PATH=/usr/local/bin:$PATH
# Load .bashrc if it exists
test -f ~/.bashrc && source ~/.bashrc