1

我正在尝试在我的个人服务器上安装 gitorious,但我对 Ruby 或到达终点线所涉及的框架和脚本不是很熟悉。

我按照以下说明在我的 CentOS 5.4 服务器上安装 gitorious:

http://www.tikalk.com/alm/blog/installing-gitorious-centos-55

该站点出现了,但是当我单击登录链接时,我会看到 500 错误屏幕,并且会通过电子邮件将异常报告发送给我。该错误被报告为“无效的字节序列”,谷歌告诉我它与 Ruby 1.9 有关。根据我的阅读,gitorious.org 使用的是 1.9,而其他人使用它,所以现在我很好奇为什么它不能在我的系统上运行。

从回溯来看,看起来无效编码可能来自数据库,在我的例子中是 MySQL 5.0.77。gitorious 数据库中的所有表都将其 DEFAULT_CHARSET 设置为 utf8。

您可以确定我从堆栈中安装的大多数组件的版本。我安装了 rails 3.0.0。如果还有什么有用的,请评论,我会回复的。

异常报告是这样的:

会话中发生 ArgumentError #new:

 US-ASCII 中的无效字节序列
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template_error.rb:43:in `split'

-------------------------------------------
要求:
-------------------------------------------

 * 网址:http://[my-server]/login
 * IP 地址:[my-ip]
 * 参数:{"controller"=>"sessions", "action"=>"new"}
 * Rails 根目录:/opt/gitorious/gitorious

-------------------------------------------
会议:
-------------------------------------------

 * 会话 ID:无
 * 数据:无

-------------------------------------------
环境:
-------------------------------------------

 * DOCUMENT_ROOT:/var/www/gitorious/public
 * HTTP_ACCEPT : application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
 * HTTP_ACCEPT_ENCODING:gzip,放气
 * HTTP_ACCEPT_LANGUAGE : en-us
 * HTTP_CONNECTION:保持活动状态
 * HTTP_COOKIE:_gitorious_sess=1a4c10ada66c96f213d6f4573d35286c
 * HTTP_HOST : [我的主机名]
 * HTTP_REFERER:http://[我的主机名]/
 * HTTP_USER_AGENT : Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7
 * PATH_INFO:/登录
 * 请求参数 :
 * REMOTE_ADDR : [my-ip]
 *远程端口:53586
 * REQUEST_METHOD : 获取
 * REQUEST_URI : /登录
 * 脚本名称:
 * SCRIPT_URI : http://[my-server]/login
 * SCRIPT_URL:/登录
 * SERVER_ADDR : [客户端 IP]
 * SERVER_ADMIN:root@localhost
 * SERVER_NAME:[我的主机名]
 * 服务器端口:80
 * SERVER_PROTOCOL:HTTP/1.1
 * SERVER_SOFTWARE : Apache/2.2.3 (CentOS)
 * _ : _
 * action_controller.request.path_parameters : {"controller"=>"sessions", "action"=>"new"}
 * action_controller.request.query_parameters:{}
 * action_controller.request.request_parameters:{}
 * action_controller.rescue.request:#
 * action_controller.rescue.response:#
 * rack.errors : #
 * 机架输入:#
 * rack.multiprocess:真
 * rack.multithread:假
 * rack.request.cookie_hash : {"_gitorious_sess"=>"1a4c10ada66c96f213d6f4573d35286c"}
 * rack.request.cookie_string : _gitorious_sess=1a4c10ada66c96f213d6f4573d35286c
 * rack.request.query_hash : {}
 * rack.request.query_string :
 * rack.run_once:假
 * 机架会话:{}
 * rack.session.options : {:key=>"_gitorious_sess", :path=>"/", :domain=>".", :expire_after=>21 天, :secure=>false, :httponly=>true , :cookie_only=>true, :secret=>"dopFactAnArcyirUckryfsObNohokOrOmFeinwojUpbofIamcicyesicCulfaydd", :id=>"1a4c10ada66c96f213d6f4573d35286c"}
 * rack.session.record : #
 * rack.url_scheme:http
 * rack.version : [1, 0]

 * 进程:22046
 * 服务器:[我的服务器]

-------------------------------------------
回溯:
-------------------------------------------

 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template_error.rb:43:in `split'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template_error.rb:43:in `source_extract'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template_error.rb:86:in `compute_backtrace'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template_error.rb:11:in `initialize'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template.rb:212:in `new'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template.rb:212:in `rescue in render_template'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/template.rb:205:in `render_template'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/base.rb:265:in `render'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/base.rb:348:in `_render_with_layout'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_view/base.rb:262:in `render'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:1250:in `render_for_file'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:945:in `render'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `block in render_with_benchmark'
 [RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
 /usr/local/ruby/ruby191/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
 [RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render_with_benchmark'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:1326:in `default_render'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:1332:in `perform_action'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:617:in `call_filters'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `block in perform_action_with_benchmark'
 [RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `block in ms'
 /usr/local/ruby/ruby191/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
 [RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in `ms'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/rescue.rb:160:in `perform_action_with_rescue'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/flash.rb:146:in `perform_action_with_flash'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:532:in `process'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/filters.rb:606:in `process_with_filters'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:391:in `process'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/base.rb:386:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/routing/route_set.rb:437:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:87:in `dispatch'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:121:in `_call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:130:in `block in build_middleware_stack'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/string_coercion.rb:25:in `call'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/head.rb:9:in `call'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in `call'
 [RAILS_ROOT]/vendor/rails/railties/lib/rails/rack/metal.rb:47:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/session/abstract_store.rb:122:in `call'
 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:29:in `block in call'
 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:9:in `cache'
 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/query_cache.rb:28:in `call'
 [RAILS_ROOT]/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in `call'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `block in call'
 :8:在“同步”中
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/rack-1.0.1/lib/rack/lock.rb:11:in `call'
 [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in `call'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:381:in `block in handle_spawn_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/utils.rb:252:in `safe_fork'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:163:in `start'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/railz/application_spawner.rb:222:在“开始”
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:253:in `block (2 levels) in spawn_rails_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:247:in `block in spawn_rails_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:80:in `block in synchronize'
 :8:在“同步”中
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server_collection.rb:79:在“同步”中
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
 /usr/local/ruby/ruby191/lib/ruby/gems/1.9.1/gems/passenger-2.2.15/bin/passenger-spawn-server:61:in `'

4

1 回答 1

1

在Marius Mårnes Mathiesen 的这篇文章中,他建议移除 i18n gem。也许这可以解决你的问题。

于 2011-02-16T11:50:28.160 回答