新手问题 测试链接 mysql 出现错误

msm · 2015年05月06日 · 最后由 jasontang168 回复于 2015年05月06日 · 1734 次阅读

mysql 服务已启动的,执行下面的语句报错: require "mysql" puts("hello,mysql") 错误信息:

D:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `r
equire': cannot load such file -- mysql/mysql_api (LoadError)
        from D:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:54:in `require'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mys
ql.rb:6:in `rescue in <top (required)>'
        from D:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql-2.9.1-x86-mingw32/lib/mys
ql.rb:2:in `<top (required)>'
        from D:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:128:in `require'
        from D:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:128:in `rescue in require'
        from D:/Ruby200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_requir
e.rb:39:in `require'
        from test_mysql.rb:1:in `<main>'

就看出是装载错误,没明白装载什么出错了,求指教

‘myslq2'

搞啥也不要在 window 下搞 ror 开发,用 windows 会出现各种诡异问题,从这里可以看出楼主的名字写错了,不是 mysql。

需要 登录 后方可回复, 如果你还没有账号请 注册新账号