[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with rails

Andre Nathan

11/26/2004 4:18:00 PM

Hi

I've just decided to try rails today. I'm following the tutorial, but in
step six, when I try to access http://localhost/friends/display, I'm
getting the following error in development.log:


Processing FriendsController#display (for ::1 at Fri Nov 26 14:09:25 BRST 2004)
Parameters: {"action"=>"display", "controller"=>"friends"}

ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
/usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/connection_adapters/abstract_adapter.rb:111:in `retrieve_connection'
/usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/base.rb:172:in `connection'
/usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/base.rb:251:in `find'
/usr/pkg/share/httpd/htdocs/testrails/app/controllers/friends_controller.rb:9:in `display'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:588:in `send'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:588:in `perform_action_without_filters'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/filters.rb:236:in `perform_action_without_benchmark'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `measure'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/rescue.rb:68:in `perform_action'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:272:in `process'
/usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:245:in `process'
/usr/pkg//lib/ruby/gems/1.8/gems/rails-0.8.5.200411252307/lib/dispatcher.rb:41:in `dispatch'
/usr/pkg/share/httpd/htdocs/testrails/public/dispatch.cgi:10

Rendering /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error)


Any ideas on what could be causing this? As the logs indicate, I'm
running the "beta" gems from gems.rubyonrails.org.

$ ruby -v
ruby 1.8.2 (2004-11-06) [i386-netbsdelf2.0.]

Please tell me is there's any other information I can provide.

Best regards,
Andre


2 Answers

Tobias Luetke

11/26/2004 7:03:00 PM

0

The current edge gems are missing a connection_establish call.

For now just add
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) to the end
of your config/environment.rb


On Sat, 27 Nov 2004 01:17:39 +0900, Andre Nathan <andre@digirati.com.br> wrote:
> Hi
>
> I've just decided to try rails today. I'm following the tutorial, but in
> step six, when I try to access http://localhost/friends/display, I'm
> getting the following error in development.log:
>
> Processing FriendsController#display (for ::1 at Fri Nov 26 14:09:25 BRST 2004)
> Parameters: {"action"=>"display", "controller"=>"friends"}
>
> ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished):
> /usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/connection_adapters/abstract_adapter.rb:111:in `retrieve_connection'
> /usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/base.rb:172:in `connection'
> /usr/pkg//lib/ruby/gems/1.8/gems/activerecord-1.1.0.200411231446/lib/active_record/base.rb:251:in `find'
> /usr/pkg/share/httpd/htdocs/testrails/app/controllers/friends_controller.rb:9:in `display'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:588:in `send'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:588:in `perform_action_without_filters'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/filters.rb:236:in `perform_action_without_benchmark'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `measure'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/rescue.rb:68:in `perform_action'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:272:in `process'
> /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/base.rb:245:in `process'
> /usr/pkg//lib/ruby/gems/1.8/gems/rails-0.8.5.200411252307/lib/dispatcher.rb:41:in `dispatch'
> /usr/pkg/share/httpd/htdocs/testrails/public/dispatch.cgi:10
>
> Rendering /usr/pkg//lib/ruby/gems/1.8/gems/actionpack-0.9.5.200411260317/lib/action_controller/templates/rescues/layout.rhtml (500 Internal Error)
>
> Any ideas on what could be causing this? As the logs indicate, I'm
> running the "beta" gems from gems.rubyonrails.org.
>
> $ ruby -v
> ruby 1.8.2 (2004-11-06) [i386-netbsdelf2.0.]
>
> Please tell me is there's any other information I can provide.
>
> Best regards,
> Andre
>
>


--
Tobi
http://blog.le...


Andre Nathan

11/26/2004 7:55:00 PM

0

On Sat, 27 Nov 2004, Tobias Luetke wrote:

> The current edge gems are missing a connection_establish call.
>
> For now just add
> ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) to the end
> of your config/environment.rb

Thanks!