Re: Ubuntu & Rails, can''t get it to work

comopasta Gr
Fri, 14 Mar 2008 14:25:15 -0000

Hi,

I''m planning to have my site up and running publicly (virtual server at
BlueHost).

So far I''ve been developing on windows using Instant Rails. But now
I''ll
have to use Apache and Linux (no Mongrel on BlueHost :-P) so I need to
practice to avoid spending days to setup the public one.

I''m using now Ubuntu 7.10 (on WMware Player). And I think I get the
same
problems as you guys. Has anyone found a solution?

Here''s my symptoms:

When creating a test application and running it with WEbrick I get the
next error:

You have a nil object when you didn''t expect it!
The error occurred while evaluating nil.to_sym

The problematic lines are:

<%= link_to ''Edit'', edit_coches_path(coches) %>
<%= link_to ''Destroy'', coches, :confirm => ''Are
you sure?'', :method =>
:delete %>
<%= link_to ''New coches'', new_coches_path %>

When those are substituted with:

<%= link_to ''Edit'', :controller=>"coches",
:action=>"edit", :id=>coches
%>
<%= link_to ''Destroy'', :confirm => ''Are you
sure?'',
:controller=>"coches", :action=>"destroy",
:id=>coches  %>
<%=link_to ''New coches'',
{:controller=>"coches", :action=>"new"} %>

Then it seems to be working ok.

The routes.rb:

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

Thanks!
--
Posted via http://www.ruby-forum.com/.