small medium large xlarge

Generic-user-small
27 Jan 2009, 18:27
Alan Baird (4 posts)

All -

I am reading the section on Active Record in the PDF (v 10) and I decided it would be a good idea to follow along with the examples. The depot was getting a little deep for me so I was skipping around (I didn’t have the whole depot installed). I got the depot from the zipfile on pragprog.com, deleted my previous depot, dropped the tables and did a rake db:migrate. Now, when I try to go to http://localhost:3000/users/new (or any other place for that matter), I don’t get anything. I have permission denied errors in the log and it’s obvious that I don’t have any users defined since the users table is empty. However, looking through the task F chapter I don’t see anything obvious on how to create users without going through the website (which I can’t load).

Can somebody please point me to the place where I need to be reading to set up users in the depot? Maybe there is something wrong fundamentally in my approach??

Thanks, Alan

Samr_small_pragsmall
27 Jan 2009, 20:56
Sam Ruby (634 posts)

Hard way: go into script/console

dave=User.new
dave.name='dave'
dave.password='secret'
dave.save!

Easy way: comment out the before_filter :authorize line in app/controller/application.rb

Generic-user-small
27 Jan 2009, 21:25
Alan Baird (4 posts)

I found the information I needed in “F4: A Sidebar, More Information.” This is the section that drops you into script/console and creates a new user when you get logged out (guess I hadn’t read that far). If anyone else is doing what I did, you also have to make sure you go in and delete all of the logfiles included in the zipfile. I was getting a “Logger::ShiftingError” that was preventing me from doing anything. After deleting the logfiles, no worries.

Alan

Generic-user-small
27 Jan 2009, 21:27
Alan Baird (4 posts)

Sam,

The screen didn’t update when I was typing my post. Thanks for the help though!

Alan

Generic-user-small
27 Jan 2009, 22:16
Alan Baird (4 posts)

Well, deleting the logfile works until rails decides to rotate the logfile. For some reason I am getting a permission denied error. However, I’m running on XP with an account that has administrative privileges. If I go in and delete the logfile, everything runs fine until rails decides it needs to rotate the logfile. What’s going on here?

Alan

You must be logged in to comment