Skip to content

Instantly share code, notes, and snippets.

@monicao
Last active December 8, 2021 01:51
Show Gist options
  • Save monicao/d372716cdfbb7e9cf692 to your computer and use it in GitHub Desktop.
Save monicao/d372716cdfbb7e9cf692 to your computer and use it in GitHub Desktop.

Revisions

  1. monicao revised this gist Mar 23, 2018. 1 changed file with 11 additions and 7 deletions.
    18 changes: 11 additions & 7 deletions notes.md
    Original 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.1.3 --disable-binary`.
    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.1.1 and set it as the default version
    # 3. Install Ruby 2.5.0 and set it as the default version

    ```
    # Install ruby version 2.1.1
    rvm install 2.1.1
    # 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.1.1 as the default version of ruby
    rvm --default use 2.1.1
    # 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.1.1
    # 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).
    ![http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.42.06%20PM.png](http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.42.06%20PM.png)

    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
    ```
  2. monicao revised this gist Aug 11, 2016. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions notes.md
    Original 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.
  3. monicao revised this gist Feb 3, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions notes.md
    Original 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
  4. monicao revised this gist Feb 3, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion notes.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    # Setting up the Ruby dev environment on Yosemite
    # 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?

  5. monicao revised this gist Jan 11, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions notes.md
    Original 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`

  6. monicao revised this gist Jan 11, 2016. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,4 @@
    # Setting up the Ruby dev environment on Mavericks

    ... should work on Yosemite as well. Add a comment here if you find any problems.
    # Setting up the Ruby dev environment on Yosemite

    ## Why would I want to do that?

  7. monicao revised this gist Dec 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion notes.md
    Original 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
    [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:

  8. monicao revised this gist Dec 2, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion notes.md
    Original 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.
    [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:

  9. monicao revised this gist Dec 2, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion notes.md
    Original 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.github.com/Homebrew/homebrew/go/install)"
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ```

    After brew is done installing run
  10. monicao revised this gist Oct 29, 2014. 1 changed file with 5 additions and 19 deletions.
    24 changes: 5 additions & 19 deletions notes.md
    Original 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`

    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.
    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: your_project_development
    database: rotten_mangoes_development
    host: localhost
    encoding: unicode
    pool: 5
    test:
    adapter: postgresql
    database: your_project_test
    database: rotten_mangoes_test
    host: localhost
    encoding: unicode
    pool: 5
    ```


    Here's my database.yml for a rails project called hooligans

    ```
    development:
    adapter: postgresql
    database: hooligans_development
    host: localhost
    encoding: unicode
    pool: 5
    ```

    To check if this works, see if you can create the database.
    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.app is started. You should see an elephant icon in your mac's top bar.
    If you see this error, make sure Postgres database is started.

    ```
    SYS:laser_shark SYS$ bin/rake db:create
  11. monicao revised this gist Oct 1, 2014. 1 changed file with 10 additions and 2 deletions.
    12 changes: 10 additions & 2 deletions notes.md
    Original 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.
    Open a terminal window. Run this command to download an install rvm and the latest version of ruby.

    ```
    brew install rvm
    \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.

    ```
  12. monicao revised this gist Sep 30, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion notes.md
    Original 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**.
    Then, run the code below, **replacing `9.2.1` with your version of postgresql**.

    ```
    mkdir -p ~/Library/LaunchAgents
  13. monicao revised this gist Sep 30, 2014. 1 changed file with 23 additions and 3 deletions.
    26 changes: 23 additions & 3 deletions notes.md
    Original 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

    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
    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
  14. monicao revised this gist Sep 30, 2014. 1 changed file with 13 additions and 9 deletions.
    22 changes: 13 additions & 9 deletions notes.md
    Original 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.

    ```
    \curl -sSL https://get.rvm.io | bash -s stable --ruby
    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
    ```

    Rails is now installed, but in order for us to use the rails executable, we need to tell rbenv to see it:
    And now we can verify Rails is installed:

    ```
    rbenv rehash
    rails -v
    # Rails 4.1.1
    ```

    And now we can verify Rails is installed:
    ## 5. Install the Postgres database server

    Install the server

    ```
    rails -v
    # Rails 4.1.1
    brew install postgresql
    ```

    ## 5. Install the Postgres.app
    Initialize the database

    "The easiest way to run Postgres on your Mac"
    ```
    initdb /usr/local/var/postgres -E utf8
    ```

    http://postgresapp.com/
    Source: http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/

    ## 6. Install the `pg` gem

  15. monicao revised this gist Sep 30, 2014. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -50,8 +50,6 @@ ruby -v
    # Should show ruby 2.1.1
    ```

    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.
  16. monicao revised this gist Sep 30, 2014. 1 changed file with 11 additions and 4 deletions.
    15 changes: 11 additions & 4 deletions notes.md
    Original 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
    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
    rbenv install 2.1.1
    rbenv global 2.1.1

    ```
    # 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
    # ruby 2.1.1
    # Should show ruby 2.1.1
    ```

    Check out this article for a list of rbenv commands: http://cbednarski.com/articles/installing-ruby/
  17. monicao revised this gist Sep 30, 2014. 1 changed file with 13 additions and 8 deletions.
    21 changes: 13 additions & 8 deletions notes.md
    Original 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 `rbenv`
    ## 2. Install ruby through `rvm`

    Now that we have Homebrew installed, we can use it to install Ruby.
    Open a terminal window.

    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.
    ```
    \curl -sSL https://get.rvm.io | bash -s stable --ruby
    ```

    To do this, run the following commands in your Terminal:
    Close the current terminal window and open a new one.

    ```
    brew install rbenv ruby-build
    rvm list # shows you all the versions of ruby installed on your computer
    ```

    ```
    rvm -h # shows you the help menu
    ```


    # Add rbenv to bash so that it loads every time you open a terminal
    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
  18. monicao revised this gist Sep 30, 2014. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions notes.md
    Original 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)

    ## Installing `brew`
    ## 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)"
    ```

    ## Install ruby through `rbenv`
    ## 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
    # Install Ruby 2.1.1 and set it as the default version
    # 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/

    ## Install rails
    ## 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
    ```

    ## Install the Postgres.app
    ## 5. Install the Postgres.app

    "The easiest way to run Postgres on your Mac"

    http://postgresapp.com/

    ## Install the `pg` gem
    ## 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
    ```

    ## Install the command line developer tools
    ## 7. Install the command line developer tools

    ### If you have XCode < 5.1.1

    @@ -102,7 +102,7 @@ gem install nokogiri
    ```


    ## Install the gems for a Rails project
    ## 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.

    ## Change `database.yml`
    ## 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.

  19. monicao revised this gist Jul 1, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions notes.md
    Original 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).
    ![http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.42.06%20PM.png](http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.42.06%20PM.png)

    ### See if it worked

  20. monicao revised this gist Jul 1, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -172,6 +172,9 @@ TCP/IP connections on port 5432?

    ![http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.37.08%20PM.png](http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.37.08%20PM.png)

    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.
  21. monicao revised this gist Jul 1, 2014. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions notes.md
    Original 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

    ![http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.37.08%20PM.png](http://monicao.s3.amazonaws.com/gist_images/Screen%20Shot%202014-07-01%20at%2012.37.08%20PM.png)

    ## 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.
  22. monicao revised this gist Jul 1, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions notes.md
    Original 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.

    ```
  23. monicao revised this gist Jul 1, 2014. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions notes.md
    Original 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

    ```
  24. monicao revised this gist Jul 1, 2014. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions notes.md
    Original 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

  25. monicao revised this gist Jul 1, 2014. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -102,17 +102,13 @@ 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
    ```
    @@ -125,8 +121,6 @@ development:
    adapter: postgresql
    database: hooligans_development
    host: localhost
    username: monica
    password:
    encoding: unicode
    pool: 5
    ```
  26. monicao revised this gist Jun 20, 2014. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions notes.md
    Original 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

  27. monicao revised this gist Jun 20, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions notes.md
    Original 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
  28. monicao revised this gist Jun 20, 2014. 1 changed file with 32 additions and 7 deletions.
    39 changes: 32 additions & 7 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -65,38 +65,57 @@ rails -v

    http://postgresapp.com/

    ## Install the `pg` gem

    ## Install the gems for a Rails project
    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

    ```
    cd /Users/monica/lighthouse/laser_shark
    bundle install
    gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
    ```

    When you are running `bundle install` inside a Rails project that uses the `pg` gem you have to run set the ARCHFLAGS first.
    ## 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/

    ```
    sudo ARCHFLAGS="-arch x86_64" bundle install
    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, use the following settings:
    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
    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

  29. monicao revised this gist Jun 19, 2014. 1 changed file with 13 additions and 5 deletions.
    18 changes: 13 additions & 5 deletions notes.md
    Original file line number Diff line number Diff line change
    @@ -66,18 +66,21 @@ rails -v
    http://postgresapp.com/


    ## Install the pg gem
    ## Install the gems for a Rails project

    Configuring Ruby for Postgres.app

    To install the pg gem, make sure you have set up your `$PATH` correctly.
    ```
    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.
  30. monicao revised this gist Jun 19, 2014. 1 changed file with 76 additions and 5 deletions.
    81 changes: 76 additions & 5 deletions notes.md
    Original 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.
    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.2 and set it as the default version
    rbenv install 2.1.2
    rbenv global 2.1.2
    # 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.2
    # 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
    ```