I have created new ruby on rails project with mysql database.
I have run mysql server by running mysql.server start
When I try to run rake db:create, I got following error:
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_init
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Expected in: flat namespace
Anybody can solve this issue?
Please reachout me. Regards.
The salient details are that you need to update the DYLD_LIBRARY_PATH to include /usr/local/mysql/lib. The easiest way of doing that is to add the following to your ~/.bashrc file:
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
I went into a little more detail in a blog post here: http://www.bartbusschots.ie/blog/?p=2186
Related
I am working on old Rails project. And when I type rake db:create I am getting following error message:
dyld: lazy symbol binding failed: Symbol not found: _vio_blocking
Referenced from: /Users/reboot/.rvm/gems/ruby-1.8.7-head/gems/mysqlplus-0.1.2/lib/mysql.bundle
Expected in: flat namespace
dyld: Symbol not found: _vio_blocking
Referenced from: /Users/reboot/.rvm/gems/ruby-1.8.7-head/gems/mysqlplus-0.1.2/lib/mysql.bundle
Expected in: flat namespace
I don't know how to solve this problem.
Below are some details about project.
Ruby 1.8.7
Rails 2.3.18
DB mysql
Gems
"will_paginate"
"daemons"
"json"
"mysqlplus"
"RedCloth"
"newrelic_rpm"
Path on .zshrc file
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Path set by .rvm
export PATH="$PATH:$HOME/.rvm/bin"
I've pulled down a new Django repository that uses MySQL and after installing it I'm getting some weird errors when I go to run the syncdb command
I initially get the following error
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: /usr/local/lib/libmysqlclient.18.dylib
Referenced from: /Users/splashlin/Developer/project/venv/lib/python2.7/site-packages/_mysql.so
Reason: image not found
I've tried fixing it with
sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Python/2.7/site-packages/_mysql.so
but just get
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: /Library/Python/2.7/site-packages/_mysql.so (No such file or directory)
Anyone have any ideas on how to move forward to resolve the issue? Pretty stuck right now. Thanks!
Try to download and install (or reinstall) the MySql's connector for Python
http://dev.mysql.com/downloads/connector/python/
Greetings
I use OSX 10.6.8 and MySQL from XAMPP.
When I run this node.js app (app.js):
var mysql = require('mysql-libmysqlclient');
var conn = mysql.createConnectionSync();
conn.connectSync('127.0.0.1', 'root', '', 'database_name');
I see this output:
Airs0urce:nodejs airs0urce$ node app.js
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /Applications/XAMPP/xamppfiles/htdocs/myproject/nodejs/node_modules/mysql-libmysqlclient/build/Release/mysql_bindings.node
Expected in: dynamic lookup
dyld: Symbol not found: _mysql_init
Referenced from: /Applications/XAMPP/xamppfiles/htdocs/myproject/nodejs/node_modules/mysql-libmysqlclient/build/Release/mysql_bindings.node
Expected in: dynamic lookup
Trace/BPT trap
Already tried couple solutions after googling.
Added mysql libs from XAMPP directory to include path this way:
export DYLD_LIBRARY_PATH=/Applications/XAMPP/xamppfiles/lib/mysql:$DYLD_LIBRARY_PATH
tried to install mysql5-devel using MacPorts, but no luck, building failed:
Airs0urce:~ airs0urce$ sudo port install mysql5-devel
---> Computing dependencies for mysql5-devel
---> Building mysql5-devel
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for mysql5-devel is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_mysql5-devel/mysql5-devel/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>
There is log file if you want to see: http://dl.dropbox.com/u/1875424/main.log
This is because of a config issue on Mac OS X Lion (10.7): lib/libmysqlclient.18.dylib (mysql 5.5 and above).
Step 1:
Make sure you set the path in ~/.profile
export ARCHFLAGS=-arch x86_64
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH
Step 2:
I am using rvm so, I used the following command:
rvmsudo ARCHFLAGS="-arch x86_64" gem install mysql2 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-opt-lib=/usr/local/mysql/lib
which has solved the issues with rails application on Mac lion and mysql x86_64.
I futzed around with this for a ton of time including setting the DVLD library path and copying the library into /usr/lib.
sudo cp /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib
Heck, anything to get it working. Finally I tried clearing the default for 64 vs 32 bit and it worked!
defaults delete com.apple.versioner.perl
Not sure if my perl is 64 or 32 bit, but my db is 64 bit and just using the default default seems to work better ;-)
I'm very new to Ruby on Rails, and have been getting the following error every time I run:
rails s
I get the following error:
dyld: lazy symbol binding failed: Symbol not found: _mysql_get_client_info
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
Expected in: flat namespace
dyld: Symbol not found: _mysql_get_client_info
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
Expected in: flat namespace
Trace/BPT trap
I've done quite a bit of research on this on StackOverflow and good ol' Google, and have tried the solutions on this post: rails server error ? (rails 3) with editing the .profile file, as well as ensuring that mysql and ruby are were both installed for 64-bit systems.
I'm running on OSX Snow Leopard, using Rails 3.0.9 and Ruby 1.8.7.
Any help would be greatly appreciated!! Thank you! :)
To run Rails 3 you need ruby 1.9.2. I would start there before going any further, please check this link out, your best bet is to use rvm to manage your ruby version. Regards
http://amerine.net/2010/02/24/rvm-rails3-ruby-1-9-2-setup.html
I'm running mac OS X Snow Leopard and I recognize that this is a common problem.
I have installed and reinstalled both the 32- and 64-bit binary installations of MySQL.
That didn't work, so I went ahead and (against my common sense) installed perl5 through macports to have an entirely different perl than the version that ships with Snow Leopard.
I re-installed DBI and DBD::mysql modules into the new perl, both with success.
And yet still:
me$ perl5 processmail
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
Referenced from: /opt/local/lib/perl5/site_perl/5.8.9/darwin- 2level/auto/DBD/mysql/mysql.bundle
Expected in: dynamic lookup
dyld: Symbol not found: _mysql_init
Referenced from: /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level/auto/DBD/mysql/mysql.bundle
Expected in: dynamic lookup
I have also tried perl5 processmail --mysql_config=/usr/local/mysql/bin/mysql_config.
Thanks in advance
Do you get the same error running your perl script as root?
Does your shell environment possibly have VERSIONER_PERL_PREFER_32_BIT=no set?
there's more info about both of these at http://www.perlmonks.org/?node_id=793727
I just finally solved this on our box by getting rid of the default setting
defaults delete com.apple.versioner.perl
Suddenly it just works! Whatever