# Action Controller: Exception caught

**URL:** <https://www.ruby-forum.com/t/action-controller-exception-caught/121209>\
**Category:** Rails\
**Created:** [November 25, 2007, 11:22am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/121209 "2007-11-25T11:22:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 25, 2007, 11:22am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/121209/1 "2007-11-25T11:22:01Z")

</div>

I’m getting:

Routing Error

no route found to match “/expenses/” with {:method=\>:get}

When pointing the browser to [http://localhost:3000/expenses/](http://localhost:3000/expenses/) as per  
the  
tutorial at [http://developer.apple.com/tools/rubyonrails.html](http://developer.apple.com/tools/rubyonrails.html). (No,  
I’m not a Mac user.)

Is this due to something I’m doing (code wise) or a configuration of  
rails or ruby? Google indicates that it may be due to rails  
configuration, but it seems more likely that I’ve made an error given  
that I’m learning.

At first I thought there was a problem with the database configuration,  
but that seems fine.

My results:

# thufir@arrakis ~/rubyCode/expenses $ thufir@arrakis ~/rubyCode/expenses $ rake db:migrate VERSION=0 --trace (in /home/thufir/rubyCode/expenses) \*\* Invoke db:migrate (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:migrate == Accounts: reverting

# – drop\_table(:accounts) → 0.0701s == Accounts: reverted (0.0707s)

\*\* Invoke db:schema:dump (first\_time)  
\*\* Invoke environment  
\*\* Execute db:schema:dump  
thufir@arrakis ~/rubyCode/expenses $ mysql --user=root  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 66  
Server version: 5.0.44-log Gentoo Linux mysql-5.0.44

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql\> use expenses\_development;  
Reading table information for completion of table and column names  
You can turn off this feature to get a quicker startup with -A

Database changed  
mysql\> show tables;  
±-------------------------------+  
| Tables\_in\_expenses\_development |  
±-------------------------------+  
| schema\_info |  
±-------------------------------+  
1 row in set (0.00 sec)

# mysql\> quit Bye thufir@arrakis ~/rubyCode/expenses $ thufir@arrakis ~/rubyCode/expenses $ rake db:migrate --trace (in /home/thufir/rubyCode/expenses) \*\* Invoke db:migrate (first\_time) \*\* Invoke environment (first\_time) \*\* Execute environment \*\* Execute db:migrate == Accounts: migrating

# – create\_table(:accounts) → 0.0166s == Accounts: migrated (0.0172s)

\*\* Invoke db:schema:dump (first\_time)  
\*\* Invoke environment  
\*\* Execute db:schema:dump  
thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ mysql --user=root  
Welcome to the MySQL monitor. Commands end with ; or \g.  
Your MySQL connection id is 68  
Server version: 5.0.44-log Gentoo Linux mysql-5.0.44

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql\> use expenses\_development;  
Reading table information for completion of table and column names  
You can turn off this feature to get a quicker startup with -A

Database changed  
mysql\> show tables;  
±-------------------------------+  
| Tables\_in\_expenses\_development |  
±-------------------------------+  
| accounts |  
| schema\_info |  
±-------------------------------+  
2 rows in set (0.00 sec)

mysql\> quit  
Bye  
thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ cat config/database.yml

development:  
adapter: mysql  
database: expenses\_development  
username: root  
password:  
host: localhost  
socket: /var/run/mysqld/mysqld.sock  
test:  
adapter: mysql  
database: expenses\_test  
username: root  
password:  
host: localhost  
socket: /var/run/mysqld/mysqld.sock  
production:  
adapter: mysql  
database: expenses\_production  
username: root  
password:  
host: localhost  
socket: /var/run/mysqld/mysqld.sock

thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ cat db/migrate/001\_accounts.rb

class Accounts \< ActiveRecord::Migration

```
    def self.up
            create_table :accounts do |table|
                    table.column :name, :string
                    table.column :budget, :float
            end
    end

    def self.down
            drop_table :accounts
    end

```

end

thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ script/server  
=\> Booting WEBrick…  
=\> Rails application started on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Ctrl-C to shutdown server; call with --help for options  
[2007-11-25 02:06:58] INFO WEBrick 1.3.1  
[2007-11-25 02:06:58] INFO ruby 1.8.6 (2007-09-24) [i686-linux]  
[2007-11-25 02:06:58] INFO WEBrick::HTTPServer#start: pid=20804  
port=3000  
127.0.0.1 - - [25/Nov/2007:02:07:05 PST] “GET /expenses/ HTTP/1.1” 404  
623

- → /expenses/  
127.0.0.1 - - [25/Nov/2007:02:07:35 PST] “GET / HTTP/1.1” 200 7552
- → /  
127.0.0.1 - - [25/Nov/2007:02:07:36 PST] “GET /javascripts/prototype.js  
HTTP/1.1” 200 71260  
[http://localhost:3000/](http://localhost:3000/) → /javascripts/prototype.js  
127.0.0.1 - - [25/Nov/2007:02:07:36 PST] “GET /javascripts/effects.js  
HTTP/1.1” 200 38200  
[http://localhost:3000/](http://localhost:3000/) → /javascripts/effects.js  
127.0.0.1 - - [25/Nov/2007:02:07:36 PST] “GET /images/rails.png  
HTTP/1.1”  
200 1787  
[http://localhost:3000/](http://localhost:3000/) → /images/rails.png  
[2007-11-25 02:07:55] INFO going to shutdown …  
[2007-11-25 02:07:55] INFO WEBrick::HTTPServer#start done.  
thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ cat /etc/gentoo-release  
Gentoo Base System release 1.12.9  
thufir@arrakis ~/rubyCode/expenses $  
thufir@arrakis ~/rubyCode/expenses $ date  
Sun Nov 25 02:18:43 PST 2007  
thufir@arrakis ~/rubyCode/expenses $

thanks,

Thufir

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 26, 2007, 5:21am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/121209/2 "2007-11-26T05:21:28Z")

</div>

You need to just go to [http://localhost:3000](http://localhost:3000). The name of your  
application is expenses, that does not mean you need to add /expenses to  
the end of your URL. Remove expenses and you should see the rails start  
page. Delete index.html from your public folder and you should be good  
to go. Then you should be able to continue with your tutorial.

---

<div class="post-metadata">

**Author:** ![Thufir](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ee7513/32.png) [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Post date:** [November 26, 2007, 9:23am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/121209/3 "2007-11-26T09:23:20Z")

</div>

On Mon, 26 Nov 2007 05:21:28 +0100, Ben J. wrote:

> You need to just go to [http://localhost:3000](http://localhost:3000). The name of your  
> application is expenses, that does not mean you need to add /expenses to  
> the end of your URL. Remove expenses and you should see the rails start  
> page. Delete index.html from your public folder and you should be good  
> to go. Then you should be able to continue with your tutorial.

After deleting expenses/public/index.html and going to \<http://  
localhost:3000/\> I get:

Routing Error

no route found to match “/” with {:method=\>:get}

Is the tutorial in error? It says:

$ script/server

Then point your web browser at [http://localhost:3000/expenses](http://localhost:3000/expenses). You  
should  
see the web page that lets you create new accounts.

[http://developer.apple.com/tools/rubyonrails.html](http://developer.apple.com/tools/rubyonrails.html)

Looking for a different tutorial 🙂

-Thufir
