Note that if you are using RVM instead of rbenv, your prompt will need a different command. $ brew install mercurial # if you didn't get this from Step 1Īdd the following lines to your ~/.bash_profile:Įxport PS1="n$C_DARKGRAY $(vcprompt -f '$C_DARKGRAY ')$C_PURPLEu$C_DARKGRAY $C_BLUEh $C_DARKGRAY: $C_LIGHTYELLOWwn$C_DARKGRAY$$C_DEFAULT "įeel free to to tweak it to your liking. In order to display information about the version control in the current directory, you will need vcprompt: In my prompt, I list my current directory, ruby version and source control branch. ![]() Having an informative prompt is extremely useful for keeping track of your development. It is highly customizable and works with the default Terminal.app. TotalTerminal is “a system-wide terminal available on a hot-key”. The final product should look similar to this: The following tools and tweaks will make your life easier. Step 4: ShellĪs a Rails developer, you will spend a lot of time in the shell. mysql, run brew info mysql to see it again. If you missed the caveats for any of the packages, eg. $ launchctl load -w ~/Library/LaunchAgents/ $ cp /usr/local/Cellar/memcached/1.4.13/ ~/Library/LaunchAgents/ Remember to follow the instructions in the caveats! For example, you will need to run the following for memcached: You only need to install the packages you need. $ brew install postgres mysql mongodb redis memcached This command will install some common databases: Running ruby -v should give you the version you just installed. Run rbenv install to see a list of rubies available. Once you’ve installed rbenv, you are ready to install Ruby 1.9. In this case, add the specified line to your ~/.bash_profile (create the file if it does not exist) and restart your shell. Pay close attention to these caveats! Homebrew uses these messages to give you further instructions for configuring your package. If which rbenv > /dev/null then eval "$(rbenv init -)" fi To enable shims and autocompletion, add rbenv init to your profile: Note: In the output of the previous command, you will see a message like this: This tutorial will show you how to install Ruby 1.9 with rbenv, but you can alternatively use RVM. The best way to upgrade is to install Ruby via a package manager. The default Ruby on Mac OS, version 1.8.7, is outdated for most Rails projects. You are now ready to install packages on your Mac: Restart your shell and run brew doctor again. The first time you run it, you will get an error like the following:Įrror: /usr/bin occurs before /usr/local/binĮdit your /etc/paths file to look like this: Once you’ve installed Homebrew, run the following command to make sure it is working correctly: Follow the simple instructions here to install it on your system. You will need it to get the rest of the packages in this guide. ![]() ![]() Homebrew is the best package manager for Mac OS X. This guide will show you how to setup your Mac environment for optimal Ruby on Rails development.
0 Comments
Leave a Reply. |