[Study Group] Week 2!

**Second Week Assignments:**

1. Do chapters 3, 4, and 5. Type all the code along with the examples and test it out. Play around with it to see if you can get different outcomes.
2. Do all the exercises. We're here to help each other so if you have questions, be sure to ask in the thread. If you can help someone out, please do!
3. Make a least one comment in this thread about something you learned, found interesting, or didn't understand very well.

**Optional**

Section 4 covers Rails flavored Ruby and Hartl suggests learning Rails, going to Ruby, then swinging back to Rails, but if you're really curious then in Chapter 4 head over to codecademy and do sections 1, 3, and 5 of the Ruby track.

8 thoughts on “[Study Group] Week 2!”

  1. I’m having trouble getting my tests to pass after completing section 5.3.2.

    When I refresh my browser to check to localhosted version of the site, I’m getting the error:

    No route matches [GET] “/static_pages/home”

    Also, none of my tests are passing now. I’m getting:

    NameError:
    undefined local variable or method `help_path’

    NameError:
    undefined local variable or method `about_path’

    etc.

    I’m just guessing that somehow rails isn’t getting that I’ve reassigned the routes to these new “paths”? Anyone have any ideas?

    **EDIT: Stackoverflow to the rescue. Apparently, you need to reload Spork (if you set it up in the Advanced Tutorial, that is). Seems a little weird that, to catch a bug, you need to restart the process that’s supposed to catch bugs. I really have no idea how any of this stuff works anyway, so I’m just going with it.**

    Reply
  2. As someone that will be coding from multiple machines, does it still make sense to set up the postgresql stuff or should I skip it? I don’t really want to install postgresql on some of the PCs I’ll be coding from but don’t want to miss out on that part of the learning.

    Reply
  3. Once again, if anyone wants help with *basic* ruby concepts, I might be able to answer questions. I’ve completed Chapter Four of this rails tutorial and written a couple of *simple* programs using the knowledge I gleaned from Zed Shaw’s Learn Ruby the Hard Way.

    Reply
  4. just a warning on Chapter 3.. I was having problems with Capybara running my tests. When I ran my code I would get undefined method `visit’ when using RSpec and Capybara in rails.

    The fix to this was renaming my “requests” folder in the specs directory to “features”

    Reply
  5. I’m getting a crazy error.

    I’m starting over with everyone else. I’ve gone through Chapter 7 a few months ago, I did through chapter 4 3 weeks ago.

    I deleted my sample_app directory to start over with this group and I ran

    rails new sample_app –skip-test-unit

    And got the following error:
    >Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/gems/execjs-2.0.2.gem)
    An error occurred while installing execjs (2.0.2), and Bundler cannot continue.
    Make sure that `gem install execjs -v ‘2.0.2’` succeeds before bundling.

    I haven’t seen that before and a little googling returned some errors for deploying to Heroku. But I’m not doing that part yet.

    Has anyone come across this?

    EDIT TO ADD: I have installed node.js like the book suggests.

    Reply
  6. Has anyone done Exercise 3.3? I’m having issues getting connected to postgresql.

    I’ve installed postgres.app and it’s running on port 5432. I’ve changed my database.yml to the following:

    development:
    adapter: postgresql
    encoding: utf8
    database: project_development
    pool: 5
    username: jody
    password:

    test:
    adapter: postgresql
    encoding: utf8
    database: project_test
    pool: 5
    username: jody
    password:

    production:
    adapter: postgresql
    encoding: utf8
    database: project_production
    pool: 5
    username: jody
    password:

    I then ran rake db:create:all

    Then in the middle of a bunch of output I get the error:
    > Is the server running locally and accepting
    connections on Unix domain socket “/var/pgsql_socket/.s.PGSQL.5432”?

    As mentioned above I did check and it is running on that port.

    Any suggestions?

    Reply
  7. Had 2 problems at the end of chapter 5.

    When I tried to merge my filling-in-layout branch, to the master branch, I was getting an error :
    error: unable to resolve reference ORIG_HEAD: Success
    fatal: Cannot lock the ref ‘ORIG_HEAD’.

    so after googling I found you just need to delete ‘ORIG_HEAD’ from your .git folder (I moved it to another folder incase) but it was 0 bytes anyways.

    Also pushing to heroku, everything uploaded except the bootstrap css wasn’t applying.. I had to do:

    rake assets:precompile

    and then I did another heroku push and it worked.

    Reply
  8. Problem From chapter 5: Inserting <%= render 'layouts/footer' %> inside div with id of container doesn’t render the footer partial while inserting the same code outside of div with id container works perfectly. Why is that? is some CSS causing this error?

    —————–Code mentioned in the book doesn’t render footer partial——————

    <%= yield %>

    <%= render 'layouts/footer' %>

    ———However following code renders footer partial——————

    <%= yield %>

    <%= render 'layouts/footer' %>

    Reply

Leave a Comment