我試圖用Rails與Ampps MySQL的垃圾桶,但是當我運行命令rails generate scaffold User name:string email:string
我收到以下錯誤:從AMPPS使用MySQL使用Rails
dyld: lazy symbol binding failed: Symbol not found: _mysql_server_init
Referenced from: /Users/myusername/.rvm/gems/ruby-2.2.1/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_server_init
Referenced from: /Users/myusername/.rvm/gems/ruby-2.2.1/gems/mysql2-0.4.2/lib/mysql2/mysql2.bundle
Expected in: flat namespace
我已經配置Ampps MySQL搭配我的環境,但我無法設法使其與軌道工作,我有以下配置。
$ which mysql
/Applications/AMPPS/mysql/bin/mysql
$ echo $PATH
/Users/myusername/.rvm/gems/ruby-2.2.1/bin:/Users/myusername/.rvm/gems/[email protected]/bin:/Users/myusername/.rvm/rubies/ruby-2.2.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myusername/.rvm/gems/ruby-2.2.1/bin:/Users/myusername/.rvm/gems/[email protected]/bin:/Users/myusername/.rvm/rubies/ruby-2.2.1/bin:/Applications/AMPPS/php-5.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myusername/.rvm/bin:/Users/myusername/.rvm/bin:/Applications/AMPPS/mysql/bin
$ ls -l /usr/local/lib/libmy*.dylib
lrwxr-xr-x 1 myusername admin 53 Jan 1 19:30 /usr/local/lib/libmysqlclient.18.dylib -> /Applications/AMPPS/mysql/lib/libmysqlclient.18.dylib
我試圖做的命令,但沒有成功:
$ gem install mysql2 -- --with-mysql-lib=/Applications/AMPPS/mysql/lib --with-mysql-include=/Applications/AMPPS/mysql/include --with-mysql-config=/Applications/AMPPS/mysql/bin/mysql_config
而且
bundle config build.mysql2 --with-mysql-lib=/Applications/AMPPS/mysql/lib --with-mysql-include=/Applications/AMPPS/mysql/include --with-mysql-config=/Applications/AMPPS/mysql/bin/mysql_config
bundle install
任何想法?
'file/Applications/AMPPS/mysql/bin/mysql'告訴你什麼?符號未找到錯誤通常是架構不匹配的結果。 – miken32
您不想將我的答案標記爲已接受的任何原因?它沒有解決你的問題嗎? – miken32
對不起,我分配的點和認爲這足以標記爲接受它我的壞:( – JohnnyAce