Project

General

Profile

Actions

Defect #10295

closed

Ruby1.9: Error 500 with accutes and special chars in user account

Added by Axel Pardemann about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Accounts / authentication
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

I get a 500 error when using acutes or special chars (like ñ) in user profile names. This is the error from the logs:

Processing UsersController#show (for 172.16.23.8 at 2012-02-22 05:57:28) [GET]
  Parameters: {"controller"=>"users", "action"=>"show", "id"=>"4"}
Rendering template within layouts/base
Rendering users/show

ActionView::TemplateError (incompatible character encodings: ASCII-8BIT and UTF-
8) on line #69 of app/views/layouts/base.html.erb:
66:
67:     <div id="content">
68:         <%= render_flash_messages %>
69:         <%= yield %>
70:         <%= call_hook :view_layouts_base_content %>
71:         <div style="clear:both;"></div>
72:     </div>

    app/views/layouts/base.html.erb:69:in `concat'
    app/views/layouts/base.html.erb:69
    app/controllers/users_controller.rb:79:in `block (2 levels) in show'
    app/controllers/users_controller.rb:78:in `show'
    thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
    thin (1.3.1) lib/thin/connection.rb:78:in `catch'
    thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
    thin (1.3.1) lib/thin/connection.rb:53:in `process'
    thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
    thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
    thin (1.3.1) lib/thin/server.rb:159:in `start'
    thin (1.3.1) lib/thin/controllers/controller.rb:86:in `start'
    thin (1.3.1) lib/thin/runner.rb:185:in `run_command'
    thin (1.3.1) lib/thin/runner.rb:151:in `run!'
    thin (1.3.1) bin/thin:6:in `<top (required)>'
    /usr/local/bin/thin:19:in `load'
    /usr/local/bin/thin:19:in `<main>'

Rendering /opt/redmine/public/500.html (500 Internal Server Error)

I found this while searching for this error: http://www.redmine.org/boards/2/topics/10535 and it states that redmine isn't compatible with Ruby 1.9 (I'm using Ruby 1.9.2) but in the install page (http://www.redmine.org/projects/redmine/wiki/RedmineInstall) it says that the current trunk (I got it from https://github.com/edavis10/redmine master branch) is compatible with ruby 1.9.x (I can only assume this is a work still in progress as later on it says that ruby 1.9.x is not supported yet.) so I post this issue to help get 1.9.x compatibility going.

Actions #1

Updated by Jean-Philippe Lang about 12 years ago

What is your database and database gem?

Actions #2

Updated by Toshi MARUYAMA about 12 years ago

Github unofficial mirror stops updating.
This mirror does not have bundle support r8904.
mysql1 has problem on Ruby 1.9.
Please use mysql2 on Ruby 1.9.
source:trunk/Gemfile@8904#L42

Actions #3

Updated by Toshi MARUYAMA about 12 years ago

  • Subject changed from Error 500 with accutes and special chars in user account to Ruby1.9: Error 500 with accutes and special chars in user account
Actions #4

Updated by Axel Pardemann about 12 years ago

Jean-Philippe: I'm using mysql, I'm really a ruby newbie so I don't know how to get the database gem, but running the command gem list gives me the following:

*** LOCAL GEMS ***

actionmailer (3.2.1, 2.3.14)
actionpack (3.2.1, 2.3.14)
activemodel (3.2.1)
activerecord (3.2.1, 2.3.14)
activeresource (3.2.1, 2.3.14)
activesupport (3.2.1, 2.3.14)
acts-as-taggable-on (2.1.1)
acts_as_list (0.1.4)
arel (3.0.0)
bcrypt-ruby (3.0.1)
blankslate (2.1.2.4)
bootstrap-sass (1.4.4)
builder (3.0.0)
bundler (1.0.22)
carrierwave (0.5.8)
charlock_holmes (0.6.8)
coffee-rails (3.2.1)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
daemons (1.1.8)
devise (1.5.0)
diff-lcs (1.1.3)
drapper (0.8.4)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.3.0)
faker (1.0.1)
ffi (1.0.11)
foreman (0.39.0)
git (1.2.5)
haml (3.1.4)
haml-rails (0.3.4)
hashery (1.4.0)
hashie (1.2.0)
hike (1.2.1)
httparty (0.8.1)
i18n (0.6.0)
journey (1.0.1)
jquery-rails (2.0.0)
json (1.6.5)
kaminari (0.13.0)
libv8 (3.3.10.4 x86-linux)
mail (2.4.1)
mime-types (1.17.2)
minitest (1.6.0)
multi_json (1.0.4)
multi_xml (0.4.1)
mysql (2.8.1)
net-ldap (0.2.2)
omniauth (1.0.2)
omniauth-ldap (1.0.2)
orm_adapter (0.0.6)
polyglot (0.3.3)
posix-spawn (0.3.6)
pygments.rb (0.2.4)
pyu-ruby-sasl (0.0.3.3)
rack (1.4.1, 1.1.3)
rack-cache (1.1)
rack-protection (1.2.0)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.1, 2.3.14)
railties (3.2.1)
rake (0.9.2.2, 0.8.7)
rdiscount (1.6.8)
rdoc (3.12, 2.5.8)
redcarpet (2.1.0)
redis (2.2.2)
redis-namespace (1.0.3)
resque (1.19.0)
ruby-mysql (2.9.4)
rubyntlm (0.1.1)
rubypython (0.5.3)
sass (3.1.15)
sass-rails (3.2.3)
seed-fu (2.2.0)
sinatra (1.3.2)
six (0.2.0)
sprockets (2.1.2)
sqlite3 (1.3.5)
stamp (0.1.6)
term-ansicolor (1.0.7)
therubyracer (0.9.9)
thin (1.3.1)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.31)
uglifier (1.0.3)
vegas (0.1.11)
warden (1.1.0)

I "need" to use Ruby 1.9.x because I'm also running GitLabHQ which requires this version and I don't want to complicate things (as I'm a newbie) using RVM.


Toshi: Alright, I'll try using the SVN version or the stable one. Does the 1.3.1 stable version support ruby 1.9.x or is it just the current trunk?

Actions #5

Updated by Jean-Philippe Lang about 12 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

You're using the mysql gem which is not encoding aware. If you want to run Redmine with ruby1.9, you have to use the mysql2 gem instead.

Actions #6

Updated by Axel Pardemann about 12 years ago

Will sudo gem install mysql2 do the trick or should I explicitly uninstall mysql gem also?

Actions #7

Updated by Etienne Massip about 12 years ago

No need to uninstall mysql but you need to update the adapter name your database.yml, see http://brainstorm.name/en/node/466.html (courtesy of Ilya Azarov, see #10046).

Actions #8

Updated by Axel Pardemann about 12 years ago

I did that (I also found the link you recommended) and I started getting lots of errors and complications. So I decided I'll try RVM and get an isolated environment with 1.8.7 and maybe try with Ruby 1.9.2 when I get this working. But one step at a time... I now know I need mysql2 adapter if working with Ruby 1.9.2 so that'll save some headaches in the future :S

Thanks a lot guys

Actions #9

Updated by Axel Pardemann about 12 years ago

In the end I resolved my problem using RVM, with separate Ruby environments for both Redmine and GitLabHQ. For Redmine I used release 1.3.1 with gem versions (Rubygems, Rails, Rack, Rake, etc...) from the table in the RedmineInstall Wiki Page, so it all went smooth.

If anyone's interested here's the how-to (it's in spanish though): http://dev.blogs.axelitus.mx/2012/02/26/instalar-y-configurar-un-servidor-para-administracion-de-proyectos/

Actions

Also available in: Atom PDF