Chronicling my experiences with ruby on rails, web application development/management.

Showing posts with label pebkac. Show all posts
Showing posts with label pebkac. Show all posts

Saturday, January 10, 2009

passenger and the case of the non-redirecting account. -solved cause i'm dumb.......

Let me explain what is going on here. In my code I want the user to create an account (from www.domain.com) and then, upon successful creation of the account, I want them to redirect to the new account's url, at say account.domain.com.


Redirect doesn't happen in Production


I'm using Passenger and Apache on a ubuntu server.


On my dev box: Mongrel from the rails app, the usual script/server stuff


So on dev, it works fine. I get redirect with reckless abandon.

In production, a different story. I get the following error (using safari, yet to try with other browsers...).Safari can’t connect to the server.
Safari can’t open the page “http://www.example69.com/accounts” because it could not connect to the server “www.example69.com”.

Why me? I should say, I can type my new url into the browser, no problem. it works fine, but it's not what I want my user's to have to do.


Did you solve this?


Embarrassingly I had a link to localhost:3000 as my redirect. Ignore this post. it's left as a reminder when i get too fucking cocky.... as a mark on my pride.

Sunday, November 23, 2008

Acts as ferret : only have one instance per development computer...

Symptoms


I kept getting this stupid error
(druby://localhost:9010) /Users/nerb/.gem/ruby/1.8/gems/activesupport-2.1.2/lib/active_support/dependencies.rb:279:in `load_missing_constant': uninitialized constant Browser (NameError)


How to solve this error


Basically I got this error because Acts as ferret was running in another app on my development box. Just do a simple script/ferret_server stop in the OLD app. Return to the new app and start the ferret server by doing script/ferret_server start


Hell, i thought it had to do with my recent updating of rails to 2.2.2, however, it did not.

Friday, November 21, 2008

Serialize... what the #@#&%!!?

Ok. For all my loyal readers, here is one thing that just wasn't jiving for me.

Serialize is Killing me!



Serialize :column is code that should be put into your model.

What that little line does is save whatever code you save to that column as yaml. Oh and make sure :column is a type :string.

Without doing anything to the column upon saving, this is an example of what could be in your db.

column: "--- \n- subscription\n- membership\n"

Now supposedly, all i have to do to use this string of yaml is to call it like i normally would, say in a for loop, and it 'un yaml fies' itself. No such luck.

What tricks do you guys use when you are serializing? i'll take any help here.

Update 11-28-08


As my exploits from Railsforum will show, i got it to work finally. Thanks to rob-wtf from Railsforum for the help!

P.s. I bookmarked their paperclip article... it's pretty good. Well minus the windows stuff.