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
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.
This problem is killing me and I feel like I've tried everything.
First off, the problem started happening when upgrading to Capistrano 3. Capistrano now utilizes /usr/bin/env before every command when deploying, to make sure the environment setup is correct.
When Capistrano goes to create symlinks to the necessary shared directory and respective files, it attempts commands like:
/usr/bin/env ln -s /full/path /different/full/path
...and then it errors out:
/usr/bin/env: ln: Too many levels of symbolic links
I realize it's not Capistrano's fault, so I began troubleshooting by ssh'ing to my server and trying the same command, and I receive the same error (which at least is good for consistency). I then try the same command without /usr/bin/env:
ln -s /full/path /different/full/path
And it works!!!! Maybe you can see the real solution that I can't?
here is the output of just the /usr/bin/env command:
rvm_bin_path=/home/deployer/.rvm/bin
GEM_HOME=/home/deployer/.rvm/gems/ruby-1.9.3-p392
TERM=xterm-256color
SHELL=/bin/bash
IRBRC=/home/deployer/.rvm/rubies/ruby-1.9.3-p392/.irbrc
SSH_CLIENT=...
OLDPWD=/home/deployer/Sites/example.com
MY_RUBY_HOME=/home/deployer/.rvm/rubies/ruby-1.9.3-p392
SSH_TTY=/dev/pts/0
USER=deployer
LS_COLORS= .....
_system_type=Linux
rvm_path=/home/deployer/.rvm
SSH_AUTH_SOCK=....
rvm_prefix=/home/deployer
MAIL=/var/mail/deployer
PATH=/home/deployer/.rvm/gems/ruby-1.9.3-p392/bin:/home/deployer/.rvm/gems/ruby-1.9.3-p392#global/bin:/home/deployer/.rvm/rubies/ruby-1.9.3-p392/bin:/home/deployer/.rvm/bin:/opt/rubyee/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/deployer/.rvm/bin
PWD=/home/deployer/Sites
LANG=en_US.UTF-8
_system_arch=i386
_system_version=12.04
rvm_version=1.26.4 (latest)
SHLVL=1
HOME=/home/deployer
LOGNAME=deployer
GEM_PATH=/home/deployer/.rvm/gems/ruby-1.9.3-p392:/home/deployer/.rvm/gems/ruby-1.9.3-p392#global
SSH_CONNECTION=....
LESSOPEN=| /usr/bin/lesspipe %s
LESSCLOSE=/usr/bin/lesspipe %s %s
RUBY_VERSION=ruby-1.9.3-p392
_system_name=Ubuntu
_=/usr/bin/env
I have also tried commands like the following, to find potential symlink loops:
find . -maxdepth 20 -type l -exec ls -ld {} +
But is not producing correct results:
lrwxrwxrwx 1 deployer deployer ...
You might not being using the same ln utility.
When invoking it directly from the interactive shell, ln might be overridden e.g. by an alias or by some shell function ln() {...;}.
This does not happen when /usr/bin/env tries to do that (AFAIK it looks for ln in PATH). I suspect that the ln it finds has issues, so you are getting this error.
This is an example scenario that might be similar to your case:
# start from an empty directory
$ ls -l
total 0
# create a problematic `ln` in the current directory
$ ln -s ln ln
$ ls -l
total 0
lrwxrwxrwx 1 me me 2 Jan 7 20:28 ln -> ln
# have an alias for the "real" ln
$ alias ln=/bin/ln
# mess up PATH
$ PATH="$PWD"
Now let's try the two alternatives, /usr/bin/env goes first:
$ /usr/bin/env ln -s /some/path /tmp/path
/usr/bin/env: ln: Too many levels of symbolic links
Then plain ln (remember that we aliased it):
$ ln -s /some/path /tmp/path
$ echo $?
0
$ /bin/ls -l /tmp/path
lrwxrwxrwx 1 me me 10 Jan 7 20:31 /tmp/path -> /some/path
So my suggestion is: look at issues with ln, e.g. by finding all different alternatives that might be visible. In bash you might run this:
$ type -a ln
Try this to find symlink loops:
find . -follow -printf ""
if you are using docker so you should install ruby in your case
docker run ruby
source
https://github.com/docker/for-win/issues/5763#issuecomment-585749243
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
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