# Simple app - problems w/ routes

**URL:** <https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574>\
**Category:** Rails\
**Created:** [October 10, 2008, 4:10am UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574 "2008-10-10T04:10:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 10, 2008, 4:10am UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/1 "2008-10-10T04:10:24Z")

</div>

Hello,  
I’m trying to get the backbone of a rails project up and running  
on localhost and also on a rails playground hosted site.

On localhost the app runs great and I can call my say/hello w/ either:  
[http://localhost:3000/controller/say/hello](http://localhost:3000/controller/say/hello) or  
[http://localhost:3000/say/hello](http://localhost:3000/say/hello),

but when I try this on my rails playground site I get this when I call  
the say/hello like this: [http://erichermann.com/say/hello:](http://erichermann.com/say/hello:)

ActionView::MissingTemplate (Missing template say/hello.html.erb in view  
path /home/c73mr0ck/railsapp/app/views):  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_view/template.rb:85:in  
`raise_missing_template_exception' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template.rb:78:in `set\_extension\_and\_file\_name’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_view/template.rb:15:in  
`initialize’

And I get this when I call the say/hello like this:  
[http://erichermann.com/controller/say/hello:](http://erichermann.com/controller/say/hello:)

ActionController::RoutingError (No route matches “/controller/say/hello”  
with {:method=\>:get}):  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_controller/routing/recognition\_optimisation.rb:67:in  
`recognize_path' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/routing/route_set.rb:384:in `recognize’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_controller/dispatcher.rb:148:in  
`handle\_request’  
ect.

My controller code looks like this

```auto
class SayController < ApplicationController
  def hello
  end
end
```

And my routes.rb code looks like this:

```auto
ActionController::Routing::Routes.draw do |map|
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end
```

One thing that could be causing a big problem is that on localhost, my  
rails version is: Rails 1.2.6

and on the Rails Playground hosting the version is: Rails 2.1.1

Any ideas how I can get this to work in both places?

Thanks,  
Clem

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 10, 2008, 4:15am UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/2 "2008-10-10T04:15:00Z")

</div>

On Oct 10, 10:10 am, Clem R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Posted viahttp://www.ruby-forum.com/.  
> You can try freezing your version of Rails into your app.

rake rails:freeze:gems

[http://www.softiesonrails.com/2008/1/3/freezing-your-rails-application](http://www.softiesonrails.com/2008/1/3/freezing-your-rails-application)

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 11, 2008, 1:20am UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/3 "2008-10-11T01:20:08Z")

</div>

Now after a bit of tech support I now get this when I go to:  
[http://erichermann.com/say/hello](http://erichermann.com/say/hello)

Code:

```auto
Expected /home/c73mr0ck/railsapp/app/controllers/say_controller.rb to 
define SayController
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:249:in 
`load_missing_constant'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in 
`const_missing'
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in 
`const_missing'
```

and I get this when I go to: [http://erichermann.com/controller/say/hello](http://erichermann.com/controller/say/hello)

```auto
no route found to match "/controller/say/hello" with {:method=>:get}
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/routing.rb:1325:in 
`recognize_path'
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/routing.rb:1315:in 
`recognize'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:40:in 
`dispatch'
/usr/local/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/fcgi_handler.rb:168:in 
`process_request'
```

It all seemed so simple at first…  
Edit/Delete Message

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 13, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/4 "2008-10-13T18:47:31Z")

</div>

Freddy A. wrote:

> Wow there are just so many issues…
> 
> First I would highly recommend that you have the same rails version in  
> both environments… Is there a reason why you want 1.2.6 on one  
> machine and 2.1 on a different machine? These versions are very  
> different and I’m sure you will find numerous of issues using the same  
> app on 1.2 and 2.1…
> 
> Next the routing:  
> In your routes you have
> 
> :controller/:action/:id
> 
> Which should be
> 
> localhost/say/hello (the localhost/controller/say/hello Not sure how  
> that works in your local environment)
> 
> Did you change the rails version in your environment.rb file when you  
> tested the code on the other env.?
> 
> Could you show your app/controllers/say\_controller.rb here?

Thanks for getting back to me on this.

In both my local and remote environment.rb file I have the rails version  
set ast this:

RAILS\_GEM\_VERSION = ‘1.2.6’

Unfortunately, for our main work project, we are running our app on a  
1.2.6 rails version so it’s safer to run all other apps on this version  
as well on localhost.

Here’s my SayController code:

class SayController \< ApplicationController  
def hello  
end  
end

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 11, 2008, 2:02am UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/5 "2008-10-11T02:02:53Z")

</div>

Wow there are just so many issues…

First I would highly recommend that you have the same rails version in  
both environments… Is there a reason why you want 1.2.6 on one  
machine and 2.1 on a different machine? These versions are very  
different and I’m sure you will find numerous of issues using the same  
app on 1.2 and 2.1…

Next the routing:  
In your routes you have

:controller/:action/:id

Which should be

localhost/say/hello (the localhost/controller/say/hello Not sure how  
that works in your local environment)

Did you change the rails version in your environment.rb file when you  
tested the code on the other env.?

Could you show your app/controllers/say\_controller.rb here?

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [October 21, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/simple-app-problems-w-routes/150574/6 "2008-10-21T17:33:40Z")

</div>

Progress,  
I finally just updated my local copy of ruby to 2.1.1. This got  
me up and running both locally and remotely.

Now I have a problem w/ my main project. In that project I have frozen  
rails and also, the environment.rb file sets the rails version to 1.2.6  
with this:

RAILS\_GEM\_VERSION = ‘1.2.6’

The project works for the most part but I am experiencing problems w/  
constants being defined and I’m getting errors like:

```auto
 LoadError in Fan_reach#index

Showing app/views/fan_reach/index.rhtml where line #79 raised:

Expected 
/Users/zenogill/rubydev/workspace/trunk/app/controllers/fan_reach_controller.rb 
to define FAN_REACH_CONTROLLER
```

Is there any way to check if this project is truly frozen to 1.2.6?
