Last active
December 8, 2021 01:51
-
-
Save monicao/d372716cdfbb7e9cf692 to your computer and use it in GitHub Desktop.
Revisions
-
monicao revised this gist
Mar 23, 2018 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Open a terminal window. Run this command to download an install rvm and the late \curl -sSL https://get.rvm.io | bash -s stable --ruby ``` In the latest version of ruby you might see this error: "Empty path passed to certificates update, functions stack". There is a bug in rvm. Run `rvm reinstall 2.5.0 --disable-binary`. Close the current terminal window and open a new one. @@ -55,19 +55,19 @@ rvm -h # shows you the help menu with all the commands you can run # 3. Install Ruby 2.5.0 and set it as the default version ``` # Install ruby version 2.5.0 rvm install 2.5.0 # this will take a while... rvm is downloading and installing ruby # Tell rvm to use 2.5.0 as the default version of ruby rvm --default use 2.5.0 # Check that you are using the latest version of ruby ruby -v # Should show ruby 2.5.0 ``` ## 4. Install rails @@ -149,8 +149,12 @@ Follow these instructions: http://stackoverflow.com/questions/23260748/manual-in 3. Download Command Line Tools for your Mac OS X version. (Probably Mavericks April / March 2014).  Update Mar 2018: If the above instructions fail follow the instructions here, which should be up to date: https://stackoverflow.com/questions/9329243/xcode-install-command-line-tools ### See if it worked Run the terminal command below. It should successfully install the nokogiri gem (an DOM parsing library). ``` gem install nokogiri ``` -
monicao revised this gist
Aug 11, 2016 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,14 @@ After brew is done installing run brew update ``` ## 1.5 Install coreutils GNU File, Shell, and Text utilities needed to compile gems. ``` brew install coreutils ``` ## 2. Install ruby through `rvm` Open a terminal window. Run this command to download an install rvm and the latest version of ruby. -
monicao revised this gist
Feb 3, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Tested on Yosemite. Should work on El Cap. Message me if it doesn't. ## Why would I want to do that? - You are tired of using vagrant - You want to run guard - You want use Sublime plugins (like RSpec or Guard plugins) - You want your code to run faster in development -
monicao revised this gist
Feb 3, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ # Setting up the Ruby dev environment on a Mac Tested on Yosemite. Should work on El Cap. Message me if it doesn't. ## Why would I want to do that? -
monicao revised this gist
Jan 11, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ - You want to run guard - You want use Sublime plugins (like RSpec or Guard plugins) - You want your code to run faster in development ## 1. Installing `brew` -
monicao revised this gist
Jan 11, 2016 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # Setting up the Ruby dev environment on Yosemite ## Why would I want to do that? -
monicao revised this gist
Dec 2, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ ## 1. Installing `brew` [Brew](http://brew.sh/) aka Homebrew is a package management system for Mac OSX. You can think of it as a command line version of the App Store. Open up the Mac Terminal and run this command to install brew on your mac: -
monicao revised this gist
Dec 2, 2014 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,15 @@ # Setting up the Ruby dev environment on Mavericks ... should work on Yosemite as well. Add a comment here if you find any problems. ## Why would I want to do that? - You want to run guard - You want use Sublime plugins (like RSpec or Guard plugins) ## 1. Installing `brew` [Brew](http://brew.sh/) aka Homebrew is a package management system for Mac OSX. You can think of it Open up the Mac Terminal and run this command to install brew on your mac: -
monicao revised this gist
Dec 2, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Open up the Mac Terminal and run this command to install brew on your mac: ``` ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` After brew is done installing run -
monicao revised this gist
Oct 29, 2014 . 1 changed file with 5 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -155,37 +155,23 @@ Follow the other setup instructions for that rails app. For `laser_shark`, you w ## 9. Change `database.yml` You will need to update the database connection settings for all your Rails applications. In config/database.yml, make sure you have the following settings for the development and test environments. Of course, replace rotten_mangoes with the name of your rails app. ``` development: adapter: postgresql database: rotten_mangoes_development host: localhost encoding: unicode test: adapter: postgresql database: rotten_mangoes_test host: localhost encoding: unicode ``` To check if the database connection settings work, see if you can create the database. ``` bin/rake db:create @@ -195,7 +181,7 @@ bin/rake db:create ### Could not connect to server: Connection refused If you see this error, make sure Postgres database is started. ``` SYS:laser_shark SYS$ bin/rake db:create -
monicao revised this gist
Oct 1, 2014 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,14 +15,22 @@ Open up the Mac Terminal and run this command to install brew on your mac: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" ``` After brew is done installing run ``` brew update ``` ## 2. Install ruby through `rvm` Open a terminal window. Run this command to download an install rvm and the latest version of ruby. ``` \curl -sSL https://get.rvm.io | bash -s stable --ruby ``` In the latest version of ruby you might see this error: "Empty path passed to certificates update, functions stack". There is a bug in rvm. Run `rvm reinstall 2.1.3 --disable-binary`. Close the current terminal window and open a new one. ``` -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -90,7 +90,7 @@ ls ``` Then, run the code below, **replacing `9.2.1` with your version of postgresql**. ``` mkdir -p ~/Library/LaunchAgents -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 23 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -79,16 +79,36 @@ Initialize the database initdb /usr/local/var/postgres -E utf8 ``` Get postgres to start automatically when your computer starts. First, figure out which version of postgres was installed by brew. ``` cd /usr/local/Cellar/postgresql/ ls # There should be a folder in here with the version number ``` Then, run the code below, **replacing 9.2.1 with your version of postgresql**. ``` mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/postgresql/9.2.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist ``` Source: http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/ ## 6. Install the `pg` gem ``` gem install pg ``` Note: This might fail. If it does, ask a TA or add a comment to this gist. ## 7. Install the command line developer tools ### If you have XCode < 5.1.1 -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 13 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Open a terminal window. ``` brew install rvm ``` Close the current terminal window and open a new one. @@ -58,24 +58,28 @@ Install rails on your system so you can create new rails projects. gem install rails ``` And now we can verify Rails is installed: ``` rails -v # Rails 4.1.1 ``` ## 5. Install the Postgres database server Install the server ``` brew install postgresql ``` Initialize the database ``` initdb /usr/local/var/postgres -E utf8 ``` Source: http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/ ## 6. Install the `pg` gem -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,8 +50,6 @@ ruby -v # Should show ruby 2.1.1 ``` ## 4. Install rails Install rails on your system so you can create new rails projects. -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 11 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,17 +30,24 @@ rvm list # shows you all the versions of ruby installed on your computer ``` ``` rvm -h # shows you the help menu with all the commands you can run ``` # 3. Install Ruby 2.1.1 and set it as the default version ``` # Install ruby version 2.1.1 rvm install 2.1.1 # this will take a while... rvm is downloading and installing ruby # Tell rvm to use 2.1.1 as the default version of ruby rvm --default use 2.1.1 # Check that you are using the latest version of ruby ruby -v # Should show ruby 2.1.1 ``` Check out this article for a list of rbenv commands: http://cbednarski.com/articles/installing-ruby/ -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 13 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,20 +15,25 @@ Open up the Mac Terminal and run this command to install brew on your mac: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" ``` ## 2. Install ruby through `rvm` Open a terminal window. ``` \curl -sSL https://get.rvm.io | bash -s stable --ruby ``` Close the current terminal window and open a new one. ``` rvm list # shows you all the versions of ruby installed on your computer ``` ``` rvm -h # shows you the help menu ``` # 3. Install Ruby 2.1.1 and set it as the default version rbenv install 2.1.1 -
monicao revised this gist
Sep 30, 2014 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ - You want to run guard - You want use Sublime plugins (like RSpec or Guard plugins) ## 1. Installing `brew` [Brew](http://brew.sh/) aka Homebrew is a package management system for Mac OSX. @@ -15,7 +15,7 @@ Open up the Mac Terminal and run this command to install brew on your mac: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" ``` ## 2. Install ruby through `rbenv` Now that we have Homebrew installed, we can use it to install Ruby. @@ -30,7 +30,7 @@ brew install rbenv ruby-build echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile source ~/.bash_profile # 3. Install Ruby 2.1.1 and set it as the default version rbenv install 2.1.1 rbenv global 2.1.1 @@ -40,7 +40,7 @@ ruby -v Check out this article for a list of rbenv commands: http://cbednarski.com/articles/installing-ruby/ ## 4. Install rails Install rails on your system so you can create new rails projects. @@ -61,21 +61,21 @@ rails -v # Rails 4.1.1 ``` ## 5. Install the Postgres.app "The easiest way to run Postgres on your Mac" http://postgresapp.com/ ## 6. Install the `pg` gem Here's how to install the pg gem with Postgres.app. http://stackoverflow.com/questions/20224483/cannot-install-pg-gem-in-mavericks-with-postgres-app ``` gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config ``` ## 7. Install the command line developer tools ### If you have XCode < 5.1.1 @@ -102,7 +102,7 @@ gem install nokogiri ``` ## 8. Install the gems for a Rails project ``` cd /Users/monica/lighthouse/laser_shark @@ -111,7 +111,7 @@ gem install nokogiri Follow the other setup instructions for that rails app. For `laser_shark`, you will have to edit your `/etc/hosts`, for example. ## 9. Change `database.yml` In config/database.yml, make sure you have the following settings. Make sure you have the `host`, the password is blank, and the username is set to your computer's username. If you are not sure what your computer's username is, try running `whoami` in the terminal. -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -93,6 +93,7 @@ Follow these instructions: http://stackoverflow.com/questions/23260748/manual-in 2. Click on Xcode > Open Developer Tools > More Developers Tools This will take you to the Downloads for Apple Developers web site. Use your AppStore Id to login. 3. Download Command Line Tools for your Mac OS X version. (Probably Mavericks April / March 2014).  ### See if it worked -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -172,6 +172,9 @@ TCP/IP connections on port 5432?  You probably have XCode 5.1.1 or higher and tried to install the command line tools via command line. See Install the command line developer tools section above. ## Help Improve this I wrote this down from memory. If any of the steps here don't work, please fork this gist, fix the issue and share with the class. -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -168,6 +168,10 @@ TCP/IP connections on port 5432? /Users/SYS/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:881:in `initialize' ``` ### XCode: Can't install software because it's not currently available on your computer  ## Help Improve this I wrote this down from memory. If any of the steps here don't work, please fork this gist, fix the issue and share with the class. -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -150,6 +150,8 @@ bin/rake db:create ## Troubleshooting ### Could not connect to server: Connection refused If you see this error, make sure Postgres.app is started. You should see an elephant icon in your mac's top bar. ``` -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -94,6 +94,13 @@ Follow these instructions: http://stackoverflow.com/questions/23260748/manual-in This will take you to the Downloads for Apple Developers web site. Use your AppStore Id to login. 3. Download Command Line Tools for your Mac OS X version. (Probably Mavericks April / March 2014). ### See if it worked ``` gem install nokogiri ``` ## Install the gems for a Rails project ``` -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -77,12 +77,22 @@ gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/ ## Install the command line developer tools ### If you have XCode < 5.1.1 The nokogiri gem needs these. See here for details: http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ ``` xcode-select --install ``` ### If you have XCode > 5.1.1 Follow these instructions: http://stackoverflow.com/questions/23260748/manual-install-of-xcode-command-line-tools-not-working 1. Open XCode 2. Click on Xcode > Open Developer Tools > More Developers Tools This will take you to the Downloads for Apple Developers web site. Use your AppStore Id to login. 3. Download Command Line Tools for your Mac OS X version. (Probably Mavericks April / March 2014). ## Install the gems for a Rails project -
monicao revised this gist
Jul 1, 2014 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -102,17 +102,13 @@ development: adapter: postgresql database: your_project_development host: localhost encoding: unicode pool: 5 test: adapter: postgresql database: your_project_test host: localhost encoding: unicode pool: 5 ``` @@ -125,8 +121,6 @@ development: adapter: postgresql database: hooligans_development host: localhost encoding: unicode pool: 5 ``` -
monicao revised this gist
Jun 20, 2014 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -137,6 +137,23 @@ To check if this works, see if you can create the database. bin/rake db:create ``` ## Troubleshooting If you see this error, make sure Postgres.app is started. You should see an elephant icon in your mac's top bar. ``` SYS:laser_shark SYS$ bin/rake db:create could not connect to server: Connection refused Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused Is the server running on host "localhost" (fe80::1) and accepting TCP/IP connections on port 5432? /Users/SYS/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/postgresql_adapter.rb:881:in `initialize' ``` ## Help Improve this -
monicao revised this gist
Jun 20, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Setting up the Ruby dev environment on Mavericks ## Why would I want to do that? - You want to run guard -
monicao revised this gist
Jun 20, 2014 . 1 changed file with 32 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -65,38 +65,57 @@ rails -v http://postgresapp.com/ ## Install the `pg` gem Here's how to install the pg gem with Postgres.app. http://stackoverflow.com/questions/20224483/cannot-install-pg-gem-in-mavericks-with-postgres-app ``` gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config ``` ## Install the command line developer tools The nokogiri gem needs these. See here for details: http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ ``` xcode-select --install ``` ## Install the gems for a Rails project ``` cd /Users/monica/lighthouse/laser_shark bundle install ``` Follow the other setup instructions for that rails app. For `laser_shark`, you will have to edit your `/etc/hosts`, for example. ## Change `database.yml` In config/database.yml, make sure you have the following settings. Make sure you have the `host`, the password is blank, and the username is set to your computer's username. If you are not sure what your computer's username is, try running `whoami` in the terminal. ``` development: adapter: postgresql database: your_project_development host: localhost username: your_mac_user_name # use whoami in the terminal to see what the user name is password: # leave the password blank encoding: unicode pool: 5 test: adapter: postgresql database: your_project_test host: localhost username: your_mac_user_name # use whoami in the terminal to see what the user name is password: # leave the password blank encoding: unicode pool: 5 ``` Here's my database.yml for a rails project called hooligans ``` @@ -110,6 +129,12 @@ development: pool: 5 ``` To check if this works, see if you can create the database. ``` bin/rake db:create ``` ## Help Improve this -
monicao revised this gist
Jun 19, 2014 . 1 changed file with 13 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,18 +66,21 @@ rails -v http://postgresapp.com/ ## Install the gems for a Rails project ``` cd /Users/monica/lighthouse/laser_shark bundle install ``` When you are running `bundle install` inside a Rails project that uses the `pg` gem you have to run set the ARCHFLAGS first. ``` sudo ARCHFLAGS="-arch x86_64" bundle install ``` Follow the other setup instructions for that rails app. For `laser_shark`, you will have to edit your `/etc/hosts`, for example. ## Change `database.yml` In config/database.yml, use the following settings: @@ -105,4 +108,9 @@ development: password: encoding: unicode pool: 5 ``` ## Help Improve this I wrote this down from memory. If any of the steps here don't work, please fork this gist, fix the issue and share with the class. -
monicao revised this gist
Jun 19, 2014 . 1 changed file with 76 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" Now that we have Homebrew installed, we can use it to install Ruby. We're going to use rbenv to install and manage our Ruby versions. rbenv makes it really easy to have several versions of ruby on your laptop and switch between them. To do this, run the following commands in your Terminal: @@ -28,10 +28,81 @@ brew install rbenv ruby-build echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile source ~/.bash_profile # Install Ruby 2.1.1 and set it as the default version rbenv install 2.1.1 rbenv global 2.1.1 ruby -v # ruby 2.1.1 ``` Check out this article for a list of rbenv commands: http://cbednarski.com/articles/installing-ruby/ ## Install rails Install rails on your system so you can create new rails projects. ``` gem install rails ``` Rails is now installed, but in order for us to use the rails executable, we need to tell rbenv to see it: ``` rbenv rehash ``` And now we can verify Rails is installed: ``` rails -v # Rails 4.1.1 ``` ## Install the Postgres.app "The easiest way to run Postgres on your Mac" http://postgresapp.com/ ## Install the pg gem Configuring Ruby for Postgres.app To install the pg gem, make sure you have set up your `$PATH` correctly. When you are running `bundle install` inside a Rails project that uses the `pg` gem you have to run set the ARCHFLAGS first. ``` sudo ARCHFLAGS="-arch x86_64" bundle install ``` ## Change `database.yml` In config/database.yml, use the following settings: ``` development: adapter: postgresql database: your_project_development host: localhost username: your_mac_user_name password: # leave the password blank encoding: unicode pool: 5 ``` Here's my database.yml for a rails project called hooligans ``` development: adapter: postgresql database: hooligans_development host: localhost username: monica password: encoding: unicode pool: 5 ```
NewerOlder