New Rails 3.1.0 App, Request Failed (code 500, Internal Error)

51 views
Skip to first unread message

JB

unread,
Sep 18, 2011, 12:39:17 PM9/18/11
to ActiveScaffold : Ruby on Rails plugin
Steps to reproduce:

Start with a fresh gemset and a fresh install of rails:
rvm gemset create tolliver
rvm use 1.9.2@tolliver
gem install rails
gem install active_scaffold

Create a brand new application:
rails new myapp
cd myapp

Add the following to Gemfile:
gem 'active_scaffold'

Run:
bundle install

Edit app/assets/javascripts/application.js
//= require jquery
//= require jquery_ujs
//= require active_scaffold
//= require_tree .

Edit apps/assets/stylesheets/application.css
/*
*= require active_scaffold
*= require_self
*= require_tree .
*/

Create config/initializers/active_scaffold.rb
ActiveScaffold.js_framework = :jquery # :prototype is the default

rails g active_scaffold Contact company:string name:string notes:text

rake db:migrate

rails server

Browse to: http://localhost:3000/contacts

Click the Create New button.

Results in: Request Failed (code 500, Internal Error)

log/development.log shows:

Started GET "/contacts/new?adapter=_list_inline_adapter" for 127.0.0.1
at 2011-09-18 11:33:45 -0500
Processing by ContactsController#new as JS
Parameters: {"adapter"=>"_list_inline_adapter"}
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_form_attribute.html.erb
(1.3ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_form_attribute.html.erb
(0.5ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_form_attribute.html.erb
(0.4ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_form.html.erb (16.3ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_base_form.html.erb
(22.9ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_create_form.html.erb
(27.3ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/_messages.html.erb
(0.5ms)
Rendered /Users/jeff/.rvm/gems/ruby-1.9.2-p136@tolliver/gems/
active_scaffold-3.1.2/frontends/default/views/
_list_inline_adapter.html.erb (4.6ms)
Completed 200 OK in 43ms (Views: 7.9ms | ActiveRecord: 0.0ms)

So it looks like everything is rendered okay. I don't see any errors
and I have no idea what I did wrong. Any suggestions?

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 19, 2011, 3:34:04 AM9/19/11
to actives...@googlegroups.com

This step is not needed, if you have gem 'jquery-rails' and you don't have gem
'prototype-rails', ActiveScaffold detects it and setup js_framework.

>
> rails g active_scaffold Contact company:string name:string notes:text
>
> rake db:migrate
>
> rails server
>
> Browse to: http://localhost:3000/contacts
>
> Click the Create New button.
>
> Results in: Request Failed (code 500, Internal Error)

It should be fixed in master branch. Try it, with gem 'active_scaffold', :git =>
'git://github.com/activescaffold/active_scaffold.git' When all it's working I
will release a new version.

--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Atastor

unread,
Sep 19, 2011, 8:45:35 AM9/19/11
to actives...@googlegroups.com
My simple case works now, thanks!


JB

unread,
Sep 19, 2011, 8:45:00 PM9/19/11
to ActiveScaffold : Ruby on Rails plugin
Thanks Sergio, but that didn't resolve the problem. I'm still getting
the 500 error.

On Sep 19, 2:34 am, "Sergio Cambra .:: entreCables S.L. ::."

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 20, 2011, 5:31:49 AM9/20/11
to actives...@googlegroups.com
On Martes, 20 de Septiembre de 2011 02:45:00 JB escribió:
> Thanks Sergio, but that didn't resolve the problem. I'm still getting
> the 500 error.

Can you send response headers of new request? It should respond with right
content type using git

JB

unread,
Sep 21, 2011, 7:34:19 PM9/21/11
to ActiveScaffold : Ruby on Rails plugin
Sergio,

The response headers don't contain a Content-Type. Here is what comes
back:

x-ua-compatible IE=Edge
Etag "8124375479aacc929ea2c535b17bfeb8"
Cache-Control max-age=0, private, must-revalidate
X-Runtime 0.198811
Server WEBrick/1.3.1 (Ruby/1.9.2/2010-12-25)
Date Wed, 21 Sep 2011 23:29:31 GMT
Set-Cookie
_myapp_session=BAh7CkkiD3Nlc3Npb25faWQGOgZFRkkiJThiZmU2N2FhZTYyYWY2NWU3ZmYyODljMjQ0MzgwZWU5BjsAVEkiEGFzOmNvbnRhY3RzBjsARnsGOglsaXN0ewZJIglwYWdlBjsARmkGSSIWaW5wdXRfZGV2aWNlX3R5cGUGOwBGSSIKTU9VU0UGOwBGSSIUaG92ZXJfc3VwcG9ydGVkBjsARlRJIhBfY3NyZl90b2tlbgY7AEZJIjFkeU1uQlI1ZVZ4YzY3dXI2enQ4b1N2YUxETHUxKy9DSytsVGFqV0VHQjVnPQY7AEY
%3D--2af029165a822cb3a8e89ada1971cd9714cc790b; path=/; HttpOnly



On Sep 20, 4:31 am, "Sergio Cambra .:: entreCables S.L. ::."

JB

unread,
Sep 21, 2011, 7:39:53 PM9/21/11
to ActiveScaffold : Ruby on Rails plugin
Okay, this is weird. I turned JavaScript support off and things seem
to work. I turned it back on, and now things are working. I wonder if
it was a caching issue with the browser? However, the response still
doesn't contain an entry for Content-Type . . .

Sergio Cambra .:: entreCables S.L. ::.

unread,
Sep 26, 2011, 5:11:38 AM9/26/11
to actives...@googlegroups.com
On Jueves, 22 de Septiembre de 2011 01:39:53 JB escribió:
> Okay, this is weird. I turned JavaScript support off and things seem
> to work. I turned it back on, and now things are working. I wonder if
> it was a caching issue with the browser? However, the response still
> doesn't contain an entry for Content-Type . . .

I got content-type text/html when it didn't work, and text/javascript now

Reply all
Reply to author
Forward
0 new messages