{"id":259,"date":"2015-05-05T22:51:10","date_gmt":"2015-05-05T22:51:10","guid":{"rendered":"https:\/\/www.tech.shinynewthings.com\/?p=259"},"modified":"2015-05-05T23:14:36","modified_gmt":"2015-05-05T23:14:36","slug":"set-up-sublime-homebrew-ruby-rails-postgres","status":"publish","type":"post","link":"https:\/\/www.tech.shinynewthings.com\/?p=259","title":{"rendered":"Set up Sublime, Homebrew, Ruby, Rails, Postgres"},"content":{"rendered":"<h1>New Installs for Mac 10.10 Yosemite<\/h1>\n<h2>Install Sublime<\/h2>\n<pre>open ~\/.bash_profile\n<\/pre>\n<p>If the following is not there already, add<\/p>\n<pre>export PATH=\/usr\/local\/bin:$PATH\n<\/pre>\n<p>Create softlink from app to bin to use sublime in terminal<\/p>\n<p>! the softlink name determines the terminal command name<\/p>\n<pre>sublime .\n<\/pre>\n<p>opens current folder as project in Sublime<\/p>\n<p>Note: Check the name of the app in Applications, update as needed<\/p>\n<pre>ln -s \/Applications\/Sublime\\ Text.app\/Contents\/SharedSupport\/bin\/subl \/usr\/local\/bin\/sublime\n<\/pre>\n<h2>Install homebrew<\/h2>\n<pre>ruby -e \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)\"\n<\/pre>\n<h2>Install Ruby 2.2 \/ rbenv<\/h2>\n<h1>Install rbenv<\/h1>\n<pre>brew install rbenv ruby-build\n<\/pre>\n<p>Add rbenv to bash so that it loads every time you open a terminal<\/p>\n<pre>echo 'if which rbenv > \/dev\/null; then eval \"$(rbenv init -)\"; fi' >> ~\/.bash_profile source ~\/.bash_profile\n<\/pre>\n<h1>Install Ruby<\/h1>\n<pre>rbenv install 2.2.2 rbenv global 2.2.2 ruby -v\n<\/pre>\n<h1>Install Rails<\/h1>\n<pre>gem install rails -v 4.2.1\n<\/pre>\n<p>Update rbenv to see new rails<\/p>\n<pre>rbenv rehash\n<\/pre>\n<h1>Install PostGres<\/h1>\n<pre>brew install postgresql\n<\/pre>\n<p>Softlink Postgres to User LaunchAgents folder to start on signin<\/p>\n<pre>mkdir -p ~\/Library\/LaunchAgents ln -sfv \/usr\/local\/opt\/postgresql\/*.plist ~\/Library\/LaunchAgents\/\n<\/pre>\n<p>start postgres \/ restart or use the following<\/p>\n<pre>launchctl load ~\/Library\/LaunchAgents\/homebrew.mxcl.postgresql.plist\n<\/pre>\n<p>Create a rails app to test<\/p>\n<h2>If you want to use Postgres<\/h2>\n<p>Note you will need to change config\/database.yml&#8217;s username to be<\/p>\n<p>the same as your OSX user account. (for example, mine is &#8216;chris&#8217;)<\/p>\n<pre>rails new myapp -d postgresql\n<\/pre>\n<p>Move into the application directory<\/p>\n<pre>cd myapp\n<\/pre>\n<p>Create the database<\/p>\n<pre>rake db:create\n<\/pre>\n<p>if you get the following error<\/p>\n<p>connections on Unix domain socket &#8220;\/tmp\/.s.PGSQL.5432&#8221;?<\/p>\n<p>remove the postgres gem and use bundle install to reinstall the correct version<\/p>\n<pre>gem uninstall \npg bundle install \nrake db:create rails server\n<\/pre>\n<h1>Use Puma as WebServer<\/h1>\n<pre>gem install puma\n<\/pre>\n<h1>Add this to the Gemfile<\/h1>\n<pre>\\#use puma webserver\ngem 'puma'\n<\/pre>\n<h1>Run Bundle install<\/h1>\n<pre>bundle install\n<\/pre>\n<p>created via trail by fire and a handful of sites including<\/p>\n<p>https:\/\/gorails.com\/setup\/osx\/10.10-yosemite<\/p>\n","protected":false},"excerpt":{"rendered":"<p>New Installs for Mac 10.10 Yosemite Install Sublime open ~\/.bash_profile If the following is not there already, add export PATH=\/usr\/local\/bin:$PATH Create softlink from app to bin to use sublime in terminal ! the softlink name determines the terminal command name sublime . opens current folder as project in Sublime Note: Check the name of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":10,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":272,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/272"}],"wp:attachment":[{"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tech.shinynewthings.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}