2017-06-01 42 views
0

試圖使用寶石「mysql的」連接到DB寶石MySQL連接錯誤

/home/sajeesh/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': libperconaserverclient.so.18: cannot open shared object file: No such file or directory - /home/sajeesh/.rvm/gems/[email protected]/gems/mysql-2.9.1/lib/mysql/mysql_api.so (LoadError) 
    from /home/sajeesh/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /home/sajeesh/.rvm/gems/[email protected]/gems/mysql-2.9.1/lib/mysql.rb:6:in `rescue in <top (required)>' 
    from /home/sajeesh/.rvm/gems/[email protected]/gems/mysql-2.9.1/lib/mysql.rb:2:in `<top (required)>' 
    from /home/sajeesh/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:133:in `require' 
    from /home/sajeesh/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require' 
    from /home/sajeesh/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:40:in `require' 
    from ./mysql.rb:7:in `<main>' 
-bash-4.1$ 

-bash-4.1$ ruby -v 
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux] 
-bash-4.1$ gem list | grep mysql 
mysql (2.9.1) 
-bash-4.1$ 

我收到錯誤是否有任何可能的解決方法這一點;我已經卸載並安裝了多次mysql gem,並且也嘗試了更高版本的ruby;似乎沒有任何工作。請幫助我解決方案。

+0

你的mysql實例是什麼版本? – digicazter

+0

其服務器版本:5.6.34-79.1 –

+0

我剛纔看到了,但是你使用'gem'mysql''還是'gem'mysql2''?因爲如果你使用'mysql',然後把它改爲'mysql2'和bundle,那麼試試吧。 – digicazter

回答

0

請確保您使用mysql2 gem然後綁定並確保您的數據庫配置文件具有正確的連接配置。

+0

感謝您的輸入;我從節點中刪除了所有的ruby版本,並安裝了最新的軟件包,它工作。 –