# Get domain

**URL:** <https://www.ruby-forum.com/t/get-domain/132068>\
**Category:** Rails\
**Created:** [March 16, 2008, 10:56am UTC](https://www.ruby-forum.com/t/get-domain/132068 "2008-03-16T10:56:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 10:56am UTC](https://www.ruby-forum.com/t/get-domain/132068/1 "2008-03-16T10:56:01Z")

</div>

Hi guys,

I’m trying to work out how to request the URL in RoR - the only help  
page I’ve found is [http://textsnippets](http://textsnippets) com/posts/show/822 which has the  
following code:

\<% page = request.request\_uri %\>  
page: \<%= page %\>

Whenever I try this, however, I get an error message.

Any advice would be much appreciated!

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 3:18pm UTC](https://www.ruby-forum.com/t/get-domain/132068/2 "2008-03-16T15:18:17Z")

</div>

> Whenever I try this, however, I get an error message.

What’s the error message?

---

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/get-domain/132068/3 "2008-03-16T15:19:40Z")

</div>

Phlip wrote:

> > Whenever I try this, however, I get an error message.
> 
> What’s the error message?

It’s:

Internal Error

Unfortunately, the server has encountered a problem displaying this  
page.

Please try again later, or if the problem persists, contact customer  
services.

Thanks,

Rob

---

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 4:07pm UTC](https://www.ruby-forum.com/t/get-domain/132068/4 "2008-03-16T16:07:11Z")

</div>

Rob Percival wrote:

> Internal Error

That’s not the error it’s the death page in the browser.

Complete error reports will contain sensitive details, so they only go  
to the  
log/production.log. Read that to find the real error. And run in  
development  
mode, to see the error in the browser.

And how are your functional tests doing? They won’t exactly match server  
behavior, but I think you can test your situation like this:

@request.request\_uri = ‘[http://www.hogthrob.com/](http://www.hogthrob.com/)’

–  
Phlip

---

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 4:17pm UTC](https://www.ruby-forum.com/t/get-domain/132068/5 "2008-03-16T16:17:10Z")

</div>

Phlip wrote:

> Rob Percival wrote:
> 
> > Internal Error
> 
> That’s not the error it’s the death page in the browser.
> 
> Complete error reports will contain sensitive details, so they only go  
> to the  
> log/production.log. Read that to find the real error. And run in  
> development  
> mode, to see the error in the browser.
> 
> And how are your functional tests doing? They won’t exactly match server  
> behavior, but I think you can test your situation like this:
> 
> @request.request\_uri = ‘[http://www.hogthrob.com/](http://www.hogthrob.com/)’
> 
> –  
> Phlip

Phlip,

Thanks very much for your reply. Unfortunately, I’m not up enough on RoR  
to know what the production.log or functional tests are! I’m just trying  
to edit a pre-existing RoR module (Hostpay with [heartinternet.co.uk](http://heartinternet.co.uk)). I  
thought I would be able to do it without mucking through RoR  
installation, setup etc, but perhaps not!

Thanks anyway,

Rob

---

<div class="post-metadata">

**Author:** ![rpierry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e19adc/32.png) [@rpierry](https://www.ruby-forum.com/u/rpierry)\
**Post date:** [March 16, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/get-domain/132068/6 "2008-03-16T16:40:10Z")

</div>

Rob Percival wrote:

> Thanks very much for your reply. Unfortunately, I’m not up enough on RoR  
> to know what the production.log or functional tests are! I’m just trying  
> to edit a pre-existing RoR module (Hostpay with [heartinternet.co.uk](http://heartinternet.co.uk)).

If you are the software’s client, not its programmer, then is this a  
tech-support question for heartinternet?

All the following assumes you have source; if you don’t, there’s nothing  
this list can do. “Nothing” is not an aphorism, because that website is  
probably too secure for us to get to its production log!

> I  
> thought I would be able to do it without mucking through RoR  
> installation, setup etc, but perhaps not!

Excellent; learning Rails is very good for you!

Get “the Agile book”, meaning /Agile Web D. with Rails/ by the  
Daves.

Next, did the original author of this code write anything into the test  
folder? Run this line:

grep test\_ test/_/_ | grep -v test\_dummy

Does it return any test cases? Next run this:

rake stats

Do you get a grid of statistics, and does it include a unit test count?  
Correlate the rows “Functional tests” and “Unit tests” with the column  
“methods” - the number should be higher than the number of methods in  
your  
Controllers and Models.

If not, you should reject this program if possible; it’s not worth  
working  
with.

However, a unit test might not capture your error, so now we are going  
to  
find the production log. Read config/deploy.rb to learn the name of the  
target server, and the path to the deployment location.

ssh to that server.

cd into the deployment folder, and look for the folders “releases” and  
“current”. They show you are in the right spot. Then cd into  
“currrent/log”,  
and enter:

less production.log

now search for the error, using the / command.

If you get this far on any of these tips, report back here. If not, you  
must  
get tech support for this product!

–  
Phlip
