Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Status: 500 Internal Server Error private method `split' called for Mime::Type in #3

Closed
niquola opened this Issue Apr 28, 2009 · 1 comment

Comments

Projects
None yet
2 participants

niquola commented Apr 28, 2009

When request with headers:

Accept application/json,application/javascript
Content-Type application/json
X-Requested-With XMLHttpRequest

We get on server:
Status: 500 Internal Server Error
private method split' called for #<Mime::Type:0xb743a2a8> /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/mime_type.rb:206:inmethod_missing'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:51:in media_type' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:117:inparseable_data?'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/request.rb:138:in POST' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/request.rb:428:inrequest_parameters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/request.rb:381:in parameters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:1279:inassign_shortcuts'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:518:in process_without_filters' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606:insass_old_process'
/usr/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/sass/plugin/rails.rb:19:in process' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:65:incall_with_exception'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:91:in dispatch' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:111:in_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:82:in initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:incall'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:29:in call' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:incache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:9:in cache' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/query_cache.rb:28:incall'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/head.rb:9:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/methodoverride.rb:24:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/params_parser.rb:15:incall'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rewindable_input.rb:25:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:93:incall'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/reloader.rb:9:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/failsafe.rb:11:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:insynchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/lock.rb:11:in call' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:106:incall'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/static.rb:31:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:46:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:in each' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/urlmap.rb:40:incall'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/rack/log_tailer.rb:17:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:incall'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:inprocess'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:ineach'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in process_client' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in initialize' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:innew'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:ininitialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:inrun'
/usr/lib/ruby/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:34:in run' /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:111 /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
script/server:3

Member

lifo commented Apr 28, 2009

Please use Rails Lighthouse - https://rails.lighthouseapp.com/

Thanks

@arunagw arunagw added a commit to arunagw/rails that referenced this issue May 28, 2011

@arunagw arunagw Fixing XMLMini_JDOM #3-0-stable 6431087

@arunagw arunagw added a commit to arunagw/rails that referenced this issue May 28, 2011

@arunagw arunagw File From Xml is working now. #3-0-stable d8b6fcb

@tenderlove tenderlove added a commit that referenced this issue May 28, 2011

@tenderlove tenderlove Merge pull request #1369 from arunagw/3-0-stable
File From Xml is working now. #3-0-stable
3332b49

@tenderlove tenderlove added a commit that referenced this issue May 30, 2011

@tenderlove tenderlove Merge branch '3-0-stable' into 3-0-8
* 3-0-stable:
  File From Xml is working now. #3-0-stable
  Fixing  XMLMini_JDOM #3-0-stable
  fixing test for mysql2
636124e

@derekkraan derekkraan added a commit to Springest/rails that referenced this issue Dec 4, 2012

@derekkraan derekkraan Try to fix it #3 (still no tests) b913804

@seuros seuros added a commit to seuros/django that referenced this issue Aug 12, 2014

@seuros seuros Add Sidekiq adapter/wrapper fixes #3 a712c07

@seuros seuros pushed a commit to seuros/django that referenced this issue Aug 12, 2014

@dhh dhh Merge pull request #5 from seuros/master
 Add Sidekiq adapter/wrapper fixes #3
12705fa

@claudiob claudiob referenced this issue in claudiob/rails Oct 15, 2014

@claudiob claudiob Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see rails#17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
c7457ab

@claudiob claudiob referenced this issue in claudiob/rails Oct 15, 2014

@claudiob claudiob Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:

```ruby
def number_field_tag(name, value = nil, options = {})
  options = options.stringify_keys
  ...
end

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see rails#17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
a9050e7

@sachin004 sachin004 added a commit to sachin004/rails that referenced this issue Dec 13, 2014

@claudiob @sachin004 claudiob + sachin004 Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:

```ruby
def number_field_tag(name, value = nil, options = {})
  options = options.stringify_keys
  ...
end

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see rails#17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
59d8c08

@jmbejar jmbejar pushed a commit to jmbejar/rails that referenced this issue Jun 2, 2015

@spastorino spastorino Merge pull request #3 from jmbejar/rails-api
Add rake-cors gem (commented) in Gemfile for rails api apps
2686beb

@keepcosmos keepcosmos pushed a commit to keepcosmos/rails that referenced this issue Jul 12, 2015

@rorlab rorlab Merge pull request #3 from luciuschoi/guides-ko
Active Job Basics: 잡 생성과 큐 등록
d8015e3

@tijmenb tijmenb added a commit to tijmenb/rails that referenced this issue Nov 3, 2015

@tijmenb tijmenb Add text template for source code
When a request is made with AJAX and an error occurs, Rails will render
a text-template for the exception instead of the HTML error page
(#11960).

The `.text.erb` variant of the `_source` template is currently missing,
causing HTML to be rendered in the response. This commit adds the text
template.

Related to #14745.

Before:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

    <div class="source " id="frame-source-0">
      <div class="info">
        Extracted source (around line <strong>#3</strong>):
      </div>
      <div class="data">
        <table cellpadding="0" cellspacing="0" class="lines">
          <tr>
```

After:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

Extracted source (around line #3):

#1 class PostsController < ApplicationController
#2   def index
*3     raise
#4   end
#5 end
```
054edd9

@tijmenb tijmenb added a commit to tijmenb/rails that referenced this issue Nov 3, 2015

@tijmenb tijmenb Add text template for source code
When a request is made with AJAX and an error occurs, Rails will render
a text-template for the exception instead of the HTML error page
(#11960).

The `.text.erb` variant of the `_source` template is currently missing,
causing HTML to be rendered in the response. This commit adds the text
template.

To keep the page scannable we only only show the first three source
extracts.

Related to #14745.

Before:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

    <div class="source " id="frame-source-0">
      <div class="info">
        Extracted source (around line <strong>#3</strong>):
      </div>
      <div class="data">
        <table cellpadding="0" cellspacing="0" class="lines">
          <tr>
```

After:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

Extracted source (around line #3):

*3     raise
```
08689a2

@dhh dhh added a commit to dhh/rails that referenced this issue Dec 14, 2015

@dhh dhh Merge pull request #3 from basecamp/readme-update
Some quick documentation edits and add a LICENSE to the repo
6c0135e

@yahonda yahonda added a commit to yahonda/rails that referenced this issue Jun 13, 2016

@yahonda yahonda Workaround #3 use composite primary key for habtm join table 4406b11

@rafaelfranca rafaelfranca pushed a commit to rafaelfranca/omg-rails that referenced this issue Jul 31, 2017

@dhh dhh Merge pull request #3 from adrianpacala/format-readme-examples
Use correct syntax highlighting in erb block
4f30570

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment