On Aug 25, 8:35 am, Arthur Rats <[email protected]>
wrote:
> got debian & xlsuite working, nearly, ran script/server and got some
> errors
>
> NoMethodError in Pages#show
>
> Showing app/views/accounts/new.html.erb where line #8 raised:
>
> You have a nil object when you didn't expect it!
> The error occurred while evaluating nil.name
>
> this happens on all pages. /admin, etc
>
> is there a way to turn this error trapping off in rails/ruby? or is this
> some data missing in the db?
>
You'll get a lot farther if you *read* the error messages. The message
above is telling you there's an error on line 8 of app/views/accounts/
new.html.erb. The offending bit of code is:
@_parent_domain.name
That variable is set in a before_filter on AccountController, line
386:
@_parent_domain = self.get_request_parent_domain
get_request_parent_domain is defined on ApplicationController, lines
457-466. It's looking for a Domain record to match the last parts of
the incoming request's domain. If none is found, it's returning
Domain.find_by_name('xlsuite.com').
Digging around further, it appears that the db:bootstrap rake tast
(that it tells you to run in INSTALL) sets up the initial host mapping
for localhost - or tries to, as I think it will only work if you've
set up subdomains off of localhost (it drops the first part of the
domain).
If you've got it deployed on a server with a DNS name rather than
locally, you'll either need to make sure that it's set up with a
subdomain (xlsuite.somedomain.com vs. somedomain.com) or you could
simply change the default case the the bottom of
get_request_parent_domain to return the right record.
Hope this helps!
--Matt Jones
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---