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
[code]
class SayController < ApplicationController
def hello
end
end
[/code]
And my routes.rb code looks like this:
[code]
ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
end
[/code]
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?
[code]
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'
[/code]
It all seemed so simple at first....
Edit/Delete Message
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?
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
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:
[code]
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
[/code]
Is there any way to check if this project is truly frozen to 1.2.6?