# Help Please

**URL:** <https://www.ruby-forum.com/t/help-please/192377>\
**Category:** Rails\
**Created:** [July 29, 2010, 10:55am UTC](https://www.ruby-forum.com/t/help-please/192377 "2010-07-29T10:55:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Simon\_D](https://www.ruby-forum.com/u/Simon_D)\
**Post date:** [July 29, 2010, 10:55am UTC](https://www.ruby-forum.com/t/help-please/192377/1 "2010-07-29T10:55:19Z")

</div>

Hello,

One of my friends paid a fair share of money for a website and the  
company that developed his site just left him and told him they would  
no longer host his site because he didn’t want to pay $150/mo for  
hosting.

I have never worked with Ruby before, but manage to transfer his  
website to Hostgator (after a great deal of headache).

I have [ArkansasLiveMusic.com](http://ArkansasLiveMusic.com) up and running on hostgator and have  
fixed numerous issues (such as depricated commands, etc), but I am  
stuck with a problem.

If you go here: [http://www.arkansaslivemusic.com/](http://www.arkansaslivemusic.com/)  
and click on ‘Purchase’ on either of the two events, and then click  
“purchase” again in the middle screen, you will get the following  
error:

Application error  
Change this error message for exceptions thrown outside of an action  
(like in Dispatcher setups or broken Ruby code) in public/500.html

Can somebody PLEASE HELP!? I am willing to pay for getting this  
resolved if that is required, :-/. We need this site up and running  
by saturday, because the provider will be tearing down another one of  
his sites.

Mongrel.Log Reads:

\*\* Daemonized, any open files are closed. Look at log/mongrel.pid and  
log/mongrel.log for info.  
\*\* Starting Mongrel listening at 0.0.0.0:12002  
\*\* Starting Rails with production environment…  
\*\* Rails loaded.  
\*\* Loading any Rails specific GemPlugins  
\*\* Signals ready. TERM =\> stop. USR2 =\> restart. INT =\> stop (no  
restart).  
\*\* Rails signals registered. HUP =\> reload (without restart). It  
might not work well.  
\*\* Mongrel 1.1.5 available at 0.0.0.0:12002  
\*\* Writing PID file to log/mongrel.pid  
/home/blake/rails\_apps/ARLiveMusic/app/views/layouts/frontend.rhtml:  
34: warning: don’t put space before argument parentheses  
/home/blake/rails\_apps/ARLiveMusic/app/views/event/view\_tickets.rhtml:  
13: warning: multiple values for a block parameter (0 for 1)  
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_view/  
helpers/capture\_helper.rb:36  
/home/blake/rails\_apps/ARLiveMusic/app/views/event/view\_tickets.rhtml:  
13: warning: multiple values for a block parameter (0 for 1)  
from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action\_view/  
helpers/capture\_helper.rb:36

Production.log Reads:  
Processing CartController#add\_to\_cart (for 75.199.46.15 at 2010-07-28  
18:00:47) [POST]  
Parameters: {“commit”=\>“Purchase”, “quantity”=\>“1”,  
“available\_ticket\_id”=\>“31”}  
[4;36;1mMobileCarrier Load (0.1ms) [0m [0;1mSELECT \* FROM  
`mobile_carriers` [0m  
[4;35;1mAvailableTicket Load (0.1ms) [0m [0mSELECT \* FROM  
`available_tickets` WHERE (`available_tickets`.`id` = 31) [0m  
[4;36;1mEvent Load (0.1ms) [0m [0;1mSELECT \* FROM `events` WHERE  
(`events`.`id` = 25) [0m  
[4;35;1mAvailableTicket Load (0.1ms) [0m [0mSELECT \* FROM  
`available_tickets` WHERE (`available_tickets`.event\_id = 25) [0m  
[4;36;1mTicket Load (0.1ms) [0m [0;1mSELECT `tickets`.\* FROM  
`tickets` WHERE (`tickets`.available\_ticket\_id IN (30,31)) [0m  
[4;35;1mSQL (0.1ms) [0m [0mselect e.id as event\_id, at.id as  
available\_ticket\_id, count(t.id) as ticket\_count from events e inner  
join available\_tickets at on e.id = at.event\_id left outer join  
tickets t on at.id = t.available\_ticket\_id where at.id in (30,31)  
group by e.id, at.id [0m  
Redirected to [http://www.arkansaslivemusic.com/cart/display\_cart](http://www.arkansaslivemusic.com/cart/display_cart)  
Completed in 5ms (DB: 0) | 302 Found [[http://www.arkansaslivemusic.com/](http://www.arkansaslivemusic.com/)  
cart/add\_to\_cart]

environment config:

# Be sure to restart your web server when you modify this file.

# Uncomment below to force Rails into production mode when

# you don’t control web/app server and can’t set it the proper way

# ENV[‘RAILS\_ENV’] ||= ‘production’

# Specifies gem version of Rails to use when vendor/rails is not

present

# RAILS\_GEM\_VERSION = ‘1.2.3’

# Bootstrap the Rails environment, frameworks, and default

configuration  
require ‘rubygems’  
require File.join(File.dirname( **FILE** ), ‘boot’)

Rails::Initializer.run do |config|

# Settings in config/environments/\* take precedence those specified

here

# Skip frameworks you’re not going to use (only works if using

vendor/rails)

# config.frameworks -= [:action\_web\_service, :action\_mailer]

# Add additional load paths for your own custom dirs

config.load\_paths += %W( #{RAILS\_ROOT}/lib/alm/ticket\_printing )

# Force all environments to use the same logger level

# (by default production uses :info, the others :debug)

config.log\_level = :debug

# Use the database for sessions instead of the file system

# (create the session table with ‘rake db:sessions:create’)

# config.action\_controller.session\_store = :active\_record\_store

# Use SQL instead of Active Record’s schema dumper when creating the

test database.

# This is necessary if your schema can’t be completely dumped by the

schema dumper,

# like if you have constraints or database-specific column types

# config.active\_record.schema\_format = :sql

# Activate observers that should always be running

# config.active\_record.observers = :cacher, :garbage\_collector

# Make Active Record use UTC-base instead of local time

# config.active\_record.default\_timezone = :utc

# See Rails::Configuration for more options

config.action\_controller.session = {  
:key =\> “\_ARLiveMusic\_session”,  
:secret =\>  
“dce8f409e48ca4c4140dd178eb6498412e773da5cfa4739329c05eb0eafb2e9c48701406fe990a2e3127fb2676ed0cdad3d1124fcf22b3d9f98ec16c3ca4c193”  
}  
end

# Add new inflection rules using the following format

# (all these examples are active by default):

# Inflector.inflections do |inflect|

# inflect.plural /^(ox)$/i, ‘\1en’

# inflect.singular /^(ox)en/i, ‘\1’

# inflect.irregular ‘person’, ‘people’

# inflect.uncountable %w( fish sheep )

# end

# Include your application configuration below

# Ticket Printing Service

require ‘default.rb’  
require ‘xsd/qname’

# require ‘defaultDriver.rb’

# require ‘defaultMappingRegistry.rb’

require ‘soap/mapping’  
require ‘soap/rpc/driver’

TPS\_LOGO\_ID = 1;  
TPS\_AD\_CODE = ‘ad001’

# Required for newsletter export

require ‘fastercsv’

# Required for credit card processing

# moved payment to individual environment files

# Required for credit card processing

require ‘payment’  
GATEWAY\_USER = ‘3XL85pT6gwqX’  
GATEWAY\_PASSWORD = ‘5W997Ar49LY7pnn4’  
TEST\_MODE = false

TPS\_ENDPOINT = ‘[http://tickets.arkansaslivemusic.com/](http://tickets.arkansaslivemusic.com/)  
TicketPrintingService.asmx’

# Required for thumnail resizing for event images

require ‘RMagick’  
include Magick  
#file system home  
EVENT\_IMAGE\_HOME = File.join(RAILS\_ROOT, ‘public’, ‘system’, ‘events’)  
#url path  
EVENT\_IMAGE\_PATH = ‘/system/events’  
THUMBNAIL\_GEOMETRY = ‘150x250’

# Flickr account info

# Requires registration and application for an API key

# [The App Garden on Flickr](http://flickr.com/services)

require ‘flickr’

# id of flickr group for venue

FLICKR\_GID = ‘422409@N21’  
FLICKR\_CONF = {  
:key =\> ‘XXXXXXXXXXXXXXXXX’,  
:secret =\> ‘XXXXXXXXXXXXXXXXXXXx’,  
:uid =\> ‘XXXXXXXXXXXXXX@N04’,  
:gid =\> FLICKR\_GID,  
:cache =\> “#{RAILS\_ROOT}/config/fickr.cache”  
}  
PHOTOS\_ENABLED = FLICKR\_CONF[:key] && FLICKR\_CONF[:secret] &&  
FLICKR\_CONF[:uid]  
FLICKR\_PHOTOS\_PER\_PAGE = 20  
FLICKR\_PREVIEW\_SIZE = ‘s’  
FLICKR\_INSERT\_SIZE = ‘m’

# Number of Featured shows to pull on homepage

FEATURED\_SHOW\_LIMIT = 15

# Application Name

APPLICATION\_NAME = “[ArkansasLiveMusic.com](http://ArkansasLiveMusic.com)”

# The email address we SHOULD send ALL mail from

APPLICATION\_EMAIL\_FROM = ‘removed\_email\_address@domain.invalid’

# Mail character set

APPLICATION\_MAIL\_CHARSET = ‘utf-8’  
APPLICATION\_ADMIN\_EMAIL = ‘removed\_email\_address@domain.invalid’

Please let me know if you need to see anything else!! THANK YOU in  
advance!

---

<div class="post-metadata">

**Author:** ![Simon\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Simon\_D](https://www.ruby-forum.com/u/Simon_D)\
**Post date:** [July 29, 2010, 4:41pm UTC](https://www.ruby-forum.com/t/help-please/192377/2 "2010-07-29T16:41:56Z")

</div>

On Jul 29, 12:05 am, Simon D [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have [ArkansasLiveMusic.com](http://ArkansasLiveMusic.com) up and running on hostgator and have  
> (like in Dispatcher setups or broken Ruby code) in public/500.html

I’ve seen stuff blow up like that when it couldn’t write to the  
session (although with a cookie store that seems fairly unlikely).  
What version of rails are you running.

Fred

---

<div class="post-metadata">

**Author:** ![Simon\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Simon\_D](https://www.ruby-forum.com/u/Simon_D)\
**Post date:** [July 29, 2010, 10:54pm UTC](https://www.ruby-forum.com/t/help-please/192377/3 "2010-07-29T22:54:51Z")

</div>

The log entry you have posted is for a successful attempt, which did  
happen under certain circumstances while I was fiddling with your  
site. If the error is making it to the logs you should see an entry  
that returns code 500 rather than ‘302 Found’. With any luck it is  
accompanied by a large stack trace.

In keeping with what Frederick said this seems to be an issue related  
to the session. In firefox you can add a ticket once, then any  
subsequent attempt will fail. If you close the browser and reopen it  
(clearing the session cookie) you will be able to add to the cart once  
again.

It appears that you cannot remove tickets from the cart either. After  
clicking remove and confirming in the pop up the ticket persists in  
the cart. This could be session related.

Also the name ‘[tickets.arkansaslivemusic.com](http://tickets.arkansaslivemusic.com)’ that is specified under  
TPS\_ENDPOINT doesn’t appear to be set up on your server.

Ethan

---

<div class="post-metadata">

**Author:** ![Simon\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f6c823/32.png) [@Simon\_D](https://www.ruby-forum.com/u/Simon_D)\
**Post date:** [July 31, 2010, 3:42am UTC](https://www.ruby-forum.com/t/help-please/192377/4 "2010-07-31T03:42:57Z")

</div>

You’ll probably also want to change the session secret, as it’s now  
publicly available in the archive…

–Matt J.
