由于 mysql2 或 mysql gems 无法在 Debian 上启动 Mongrel(或 Passenger)

发布于 2024-10-19 08:18:12 字数 6061 浏览 3 评论 0原文

我最初将其发布在超级用户上,但现在认为它应该放在这里...

我正在尝试将我的 RoR Web 应用程序移植到 DreamHost VPS。我已经升级了VPS --> Ruby 1.9.2 从 1.8.7 开始,我使用 Rails 3.0.1 和 mysql2 (0.2.6) gem。尝试启动 mongrel 时出现以下错误:

/usr/bin/ruby1.8:符号查找错误:/home/USERNAME/.gems/gems/mysql2-0.2.6/lib/mysql2/mysql2.so:未定义符号:rb_intern2

...所以我尝试使用 mysql (2.8.1) 改为 gem 并得到以下错误:

Mysql 参数类型错误(预期结构)(TypeError)

0 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in real_connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in
connect'
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 in initialize'
3 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 位于
新'
4 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in mysql_connection'
5 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in
发送'
6 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 位于
checkout_new_connection'
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 in checkout'
9 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 循环'
10 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in checkout'
11 /usr/lib/ruby/1.8/monitor.rb 242 位于
同步'
12 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 189 in checkout'
13 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 96 位于
连接'
14 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 318 in retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specation.rb 97 位于
retrieve_connection'
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specation.rb 89 在 connection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 位于
create_has_and_belongs_to_many_reflection'
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 in has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 位于
has_and_belongs_to_many'
20 /home/用户名/portfoliofinearts.ca/farr/app/models/project.rb 3
21 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 239 in require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 239 位于
require'
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 227 in load_dependency'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 239 位于
require'
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 346 in require_or_load'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 300 位于
depend_on'
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 216 in require_dependency'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 位于
eager_load!'
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in each'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 位于
eager_load!'
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in each'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 位于
eager_load!'
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 in eager_load!'
34 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application/finisher.rb 41
35 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 25 in
instance_exec'
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 25 in run'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 50 位于
run_initializers'
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 49 in each'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 49 位于
run_initializers'
40 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 134 in 初始化!'
41 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 中
发送'
42 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in method_missing'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 位于
gem_original_require'
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 在 require'
46 配置.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in
instance_eval'
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in initialize'
49 config.ru 1 位于
新'
50 配置.ru 1

我更喜欢使用 mysql2,所以这是我正在寻找的首选解决方案,但我肯定会感谢对这两个问题的意见。

我在我的开发环境(Windows)中没有遇到类似的问题

I originally posted this at Super User, but now think it should be here instead...

I'm trying to port my RoR webapp over to a DreamHost VPS. I've upgraded the VPS --> Ruby 1.9.2 from 1.8.7 and am using Rails 3.0.1 and the mysql2 (0.2.6) gem. I'm getting the following error when trying to start mongrel:

/usr/bin/ruby1.8: symbol lookup error: /home/USERNAME/.gems/gems/mysql2-0.2.6/lib/mysql2/mysql2.so: undefined symbol: rb_intern2

...so I tried using the mysql (2.8.1) gem instead and get the following error:

wrong argument type Mysql (expected Struct) (TypeError)

0 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in real_connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in
connect'
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 in initialize'
3 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in
new'
4 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in mysql_connection'
5 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in
send'
6 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 230 in new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 in
checkout_new_connection'
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 in checkout'
9 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in
loop'
10 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in checkout'
11 /usr/lib/ruby/1.8/monitor.rb 242 in
synchronize'
12 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 189 in checkout'
13 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 96 in
connection'
14 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 318 in retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 97 in
retrieve_connection'
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 89 in connection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 in
create_has_and_belongs_to_many_reflection'
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 in has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 in
has_and_belongs_to_many'
20 /home/USERNAME/portfoliofinearts.ca/farr/app/models/project.rb 3
21 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in
require'
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 227 in load_dependency'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in
require'
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 346 in require_or_load'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 300 in
depend_on'
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 216 in require_dependency'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 in
eager_load!'
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in each'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in
eager_load!'
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in each'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in
eager_load!'
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 in eager_load!'
34 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application/finisher.rb 41
35 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 in
instance_exec'
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 in run'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 50 in
run_initializers'
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 in each'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 in
run_initializers'
40 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 134 in initialize!'
41 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in
send'
42 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in method_missing'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in
gem_original_require'
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in require'
46 config.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in
instance_eval'
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in initialize'
49 config.ru 1 in
new'
50 config.ru 1

I'd prefer to use mysql2, so that's the preferred solution I'm looking for, but I will certainly appreciate input on either problem.

I'm not encountering any problems such as this in my development environment (which is windows)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷梦 2024-10-26 08:18:12

您提到您正在运行 Ruby 1.9.2,但您的错误转储看起来正在运行 Ruby 1.8 我不确定这是否会导致问题,但这似乎是一个潜在的问题。

我会卸载 ruby​​1.8 并看看它是否修复了任何问题。

sudo apt-get 删除 ruby​​1.8

You'd mentioned that you're running Ruby 1.9.2 but your error dump looks like it's running Ruby 1.8 I'm not sure that this would cause the problem or not but it seems like a potential issue.

I'd uninstall ruby1.8 and see if it fixes anything.

sudo apt-get remove ruby1.8

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文