# Error when trying to run expense program

**URL:** <https://www.ruby-forum.com/t/error-when-trying-to-run-expense-program/107383>\
**Category:** Rails\
**Created:** [June 21, 2007, 3:11am UTC](https://www.ruby-forum.com/t/error-when-trying-to-run-expense-program/107383 "2007-06-21T03:11:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fahd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/58f4c7/32.png) [@Fahd](https://www.ruby-forum.com/u/Fahd)\
**Post date:** [June 21, 2007, 3:11am UTC](https://www.ruby-forum.com/t/error-when-trying-to-run-expense-program/107383/1 "2007-06-21T03:11:28Z")

</div>

Guys, I m trying to get up to speed on Rails via the Apple tutorial  
at:[http://developer.apple.com/tools/rubyonrails.html](http://developer.apple.com/tools/rubyonrails.html)

Problem is when I try and access localhost:3000/expenses I get the  
following error. It may be a breeze for you to figure out but since I  
dont know jack about rails it seems cryptic to me. Application.rb seems  
to be very similar to the database.yml file.

I’m running everything on Mac (mysql)

Cheers

./script/…/config/…/app/controllers/application.rb:5: syntax error,  
unexpected ‘:’, expecting kEND  
./script/…/config/…/app/controllers/application.rb:7: syntax error,  
unexpected ‘:’, expecting kEND  
database: expenses\_development  
^  
./script/…/config/…/app/controllers/application.rb:8: syntax error,  
unexpected ‘:’, expecting kEND  
username: root  
^  
./script/…/config/…/app/controllers/application.rb:9: syntax error,  
unexpected ‘:’, expecting kEND  
./script/…/config/…/app/controllers/application.rb:10: unknown regexp  
options - yql  
./script/…/config/…/app/controllers/application.rb:15: syntax error,  
unexpected ‘:’, expecting kEND  
./script/…/config/…/app/controllers/application.rb:17: syntax error,  
unexpected ‘:’, expecting kEND  
database: expenses\_development  
^  
./script/…/config/…/app/controllers/application.rb:18: syntax error,  
unexpected ‘:’, expecting kEND  
username: root  
^  
./script/…/config/…/app/controllers/application.rb:19: syntax error,  
unexpected ‘:’, expecting kEND  
./script/…/config/…/app/controllers/application.rb:20: unknown regexp  
options - yql  
./script/…/config/…/app/controllers/application.rb:22: syntax error,  
unexpected ‘:’, expecting kEND  
./script/…/config/…/app/controllers/application.rb:24: syntax error,  
unexpected ‘:’, expecting kEND  
database: expenses\_production  
^  
./script/…/config/…/app/controllers/application.rb:25: syntax error,  
unexpected ‘:’, expecting kEND  
username: root  
^  
./script/…/config/…/app/controllers/application.rb:26: syntax error,  
unexpected ‘:’, expecting kEND  
password:  
^  
./script/…/config/…/app/controllers/application.rb:27: unknown regexp  
options - yql  
./script/…/config/…/app/controllers/application.rb:28: syntax error,  
unexpected ‘\<’, expecting kEND  
\< ActionController::Base  
^  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:203:in  
`load_without_new_constant_marking' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:203:in `load\_file’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:202:in `load\_file’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:94:in  
`require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:60:in `depend\_on’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:442:in  
`require_dependency' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:110:in `prepare\_application’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:39:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:in `process’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in  
`synchronize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in `process’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in  
`process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in  
`process_client' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in  
`initialize' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in `new’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `initialize’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in  
`new' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in `run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in `each’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:in `run’  
/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in  
`run' /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:488:in `load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:488:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new\_constants\_in’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:488:in  
`load' /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:60 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem\_original\_require’  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active\_support/dependencies.rb:342:in  
`new_constants_in' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem_original_require' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’  
script/server:3

---

<div class="post-metadata">

**Author:** ![Fahd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/58f4c7/32.png) [@Fahd](https://www.ruby-forum.com/u/Fahd)\
**Post date:** [June 21, 2007, 6:22am UTC](https://www.ruby-forum.com/t/error-when-trying-to-run-expense-program/107383/2 "2007-06-21T06:22:17Z")

</div>

in a new rails app, application.rb begins life as an empty class,  
something like:  
class ApplicationController \< ActionController::Base

# Pick a unique cookie name to distinguish our session data from

others’  
session :session\_key =\> ‘\_myapp\_session\_id’  
end

so unless this expenses app of yours has put code in application.rb,  
yours should be about the same.

judging by the errors below it sounds like you have yml syntax in in a  
ruby file. the yml should be in a .yml file… database.yml typically  
looks like

development:  
database: myapp\_development  
username: root  
password:

test:  
database: myapp\_test  
username: root  
password:

if you’re new to ruby and rails, then the yml syntax of “key: value”  
can be confusing next to ruby/rails “some\_method :symbol”… subtle  
difference in the position of the colon. hang in there and you’ll get  
it.

---

<div class="post-metadata">

**Author:** ![Fahd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/58f4c7/32.png) [@Fahd](https://www.ruby-forum.com/u/Fahd)\
**Post date:** [June 27, 2007, 1:37am UTC](https://www.ruby-forum.com/t/error-when-trying-to-run-expense-program/107383/3 "2007-06-27T01:37:46Z")

</div>

Dude, you rock for volunteering to respond. And I havent even read your  
response yet! I’ll look into making the changes you outlined and get  
back to you brah.

thanks  
Fahd

Jeff Emminger wrote:

> in a new rails app, application.rb begins life as an empty class,  
> something like:  
> class ApplicationController \< ActionController::Base
> 
> # Pick a unique cookie name to distinguish our session data from
> 
> others’  
> session :session\_key =\> ‘\_myapp\_session\_id’  
> end
> 
> so unless this expenses app of yours has put code in application.rb,  
> yours should be about the same.
> 
> judging by the errors below it sounds like you have yml syntax in in a  
> ruby file. the yml should be in a .yml file… database.yml typically  
> looks like
> 
> development:  
> database: myapp\_development  
> username: root  
> password:
> 
> test:  
> database: myapp\_test  
> username: root  
> password:
> 
> if you’re new to ruby and rails, then the yml syntax of “key: value”  
> can be confusing next to ruby/rails “some\_method :symbol”… subtle  
> difference in the position of the colon. hang in there and you’ll get  
> it.
