由于 mysql2 或 mysql gems 无法在 Debian 上启动 Mongrel(或 Passenger)
我最初将其发布在超级用户上,但现在认为它应该放在这里...
我正在尝试将我的 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'
connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 ininitialize'
新'
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 inmysql_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 innew_connection'
checkout_new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 位于
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 incheckout'
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 incheckout'
同步'
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 incheckout'
连接'
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 inretrieve_connection'
retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specation.rb 97 位于
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specation.rb 89 在connection'
create_has_and_belongs_to_many_reflection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 位于
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 inhas_and_belongs_to_many'
has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 位于
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 inrequire'
require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 239 位于
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 227 inload_dependency'
require'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 239 位于
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 346 inrequire_or_load'
depend_on'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 300 位于
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependency.rb 216 inrequire_dependency'
eager_load!'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 位于
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 ineach'
eager_load!'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 位于
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 ineach'
eager_load!'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 位于
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 ineager_load!'
instance_exec'
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
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 25 inrun'
run_initializers'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 50 位于
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 49 ineach'
run_initializers'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initialized.rb 49 位于
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 inmethod_missing'
gem_original_require'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 位于
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 在require'
instance_eval'
46 配置.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 ininitialize'
新'
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'
connect'
1 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 600 in
2 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 164 ininitialize'
new'
3 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 in
4 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/mysql_adapter.rb 36 inmysql_connection'
send'
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 innew_connection'
checkout_new_connection'
7 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 238 in
8 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 194 incheckout'
loop'
9 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 in
10 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 190 incheckout'
synchronize'
11 /usr/lib/ruby/1.8/monitor.rb 242 in
12 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 189 incheckout'
connection'
13 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 96 in
14 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb 318 inretrieve_connection'
retrieve_connection'
15 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 97 in
16 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb 89 inconnection'
create_has_and_belongs_to_many_reflection'
17 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1804 in
18 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/associations.rb 1411 inhas_and_belongs_to_many'
has_and_belongs_to_many'
19 /home/USERNAME/.gems/gems/activerecord-3.0.1/lib/active_record/autosave_association.rb 137 in
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 inrequire'
require'
22 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in
23 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 227 inload_dependency'
require'
24 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 239 in
25 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 346 inrequire_or_load'
depend_on'
26 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 300 in
27 /home/USERNAME/.gems/gems/activesupport-3.0.1/lib/active_support/dependencies.rb 216 inrequire_dependency'
eager_load!'
28 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 138 in
29 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 ineach'
eager_load!'
30 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 137 in
31 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 ineach'
eager_load!'
32 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/engine.rb 135 in
33 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 108 ineager_load!'
instance_exec'
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
36 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 25 inrun'
run_initializers'
37 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 50 in
38 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 ineach'
run_initializers'
39 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/initializable.rb 49 in
40 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 134 ininitialize!'
send'
41 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 in
42 /home/USERNAME/.gems/gems/railties-3.0.1/lib/rails/application.rb 77 inmethod_missing'
gem_original_require'
43 /home/USERNAME/mydomain.com/test_app/config/environment.rb 10
44 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 in
45 /usr/lib/ruby/1.8/rubygems/custom_require.rb 31 inrequire'
instance_eval'
46 config.ru 3
47 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in
48 /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 ininitialize'
new'
49 config.ru 1 in
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您提到您正在运行 Ruby 1.9.2,但您的错误转储看起来正在运行 Ruby 1.8 我不确定这是否会导致问题,但这似乎是一个潜在的问题。
我会卸载 ruby1.8 并看看它是否修复了任何问题。
sudo apt-get 删除 ruby1.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