Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tarry Quint
2,347 PointsRuby on Rails: Subl - Command Not Found
Hey guys, I'm new to RoR and I'm having a problem with adding sublime text 2. I'm running mac os x 10.8.2.
Here is what I got:
$ cd first_app/ $ subl Gemfile -bash: subl: command not found
My sublime text 2 is in my applications folder. Please help, I'm stuck!
Thank You
5 Answers
Philipp Antar
7,216 PointsSorry, I'm just stupid. What I told you in my first reply will create a temporary alias. To make this permanent you have to add the same line
alias subl='open -a /Applications/Sublime\ Text\ 2.app'
to the file "~/.bash_profile". To access this file open Sublime Text 2, press 'cmd'+'o' and in the following window press 'cmd'+'shift'+'period' (thats "."). This will show the hidden files in the your home directory, including bash_profile. If the file doesn't exist you can create it. Remember to save the .bash_profile file and restart your terminal for the changes to take effect.
Sorry for the confusion, I hope this helps :D
Philipp Antar
7,216 PointsRun this in your terminal:
alias subl='open -a /Applications/Sublime\ Text\ 2.app'
This will create an alias, which will subsequently enable you to open sublime withe subl command. open -a stands for "open application".
To view all your aliases simply run alias in your terminal. To remove an alias run unalias aliasname. HTH :)
Tarry Quint
2,347 PointsThanks Philipp for your help. I ran that line of code and then viewed alias and it's in there.
But when I type the command:
subl Gemfile
-bash: subl: command not found
Still not working. Here is the ruby tutorial instructions I'm working on. http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2#sec-bundler
Maybe I'm missing something.
Thank You
Tarry Quint
2,347 PointsNo worries, your definitely much better at this then me!
I opened my home directory and bash_profile didn't exist. How do I go about saving .bash_profile?
Thank You.
Philipp Antar
7,216 PointsJust save it as you would save any text file. However, be sure to put it in your home directory (the one that has your name on a normal OS X installation). And make sure to include the dot in front of the file name. Sublime will ask you if you are sure to use the dot (you are :D). Sublime will also inform you in case the file .bash_profile does exist. In that case you might be better off to append the line to an existing file so you don't break anything should you overwrite it.
FYI the dot in front of a file denotes hidden files, therefore you won't be able to see them in a normal Finder window. The keyboard shortcut I told you (cmd + shift + .) also only works in "open"-dialogs. Good luck :)