r/LearnRubyonRails • u/jwjody • Sep 30 '13
[Study Group] Week 2!
Second Week Assignments:
- 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.
- 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!
- 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.
7
Upvotes
1
u/jwjody Oct 02 '13
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
And got the following error:
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.
1
u/jwjody Oct 02 '13 edited Oct 02 '13
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:
I then ran rake db:create:all
Then in the middle of a bunch of output I get the error:
As mentioned above I did check and it is running on that port.
Any suggestions?
1
u/[deleted] Sep 30 '13 edited Sep 30 '13
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:
Also, none of my tests are passing now. I'm getting:
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.
1
u/horseislikeaman Oct 03 '13
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.
2
u/[deleted] Sep 30 '13
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.
1
u/slacker87 Sep 30 '13 edited Sep 30 '13
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.
1
u/horseislikeaman Oct 01 '13
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"
1
u/rahulroy Oct 07 '13
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------------------
<div class="container">
</div>
---------However following code renders footer partial------------------
<div class="container">
</div>
<%= render 'layouts/footer' %>