mysql2 gem Can't build native extensions

后端 未结 6 1876
离开以前
离开以前 2021-01-05 07:02

Our intern\'s computer is having problems installing the mysql2 gem. We just upgraded his computer from OS X 10.6 to 10.8 (Mountain Lion). I have tried installing mysql th

6条回答
  •  感情败类
    2021-01-05 07:25

    Unfortunately the install process is very segmented and it's difficult to isolate what your problem might be without looking at your steps overall.

    Without knowing more about your install steps, here are a few notes I followed that got me to a stable Rails Mountain Lion development box (again, apologies that this isn't more specific).

    1. Instructions for RVM, Ruby: moncefbelyamani.com

      Note: There were certainly steps here that I took via suggestions from brew doctor and 'rvm requirements' I've NEVER taken in previous setups.

      Notes like:

      • Xcode 4.3+ only use ruby-1.9.3-p125+ (and telling me if I had compilation issues to downgrade to Xcode 4.1)
      • Using brew install autoconf automake apple-gcc42
      • Using brew tap homebrew/dupes
      • And others...
    2. Rails specific Instructions: railsapps.github.com

    3. For mysql (skipping to the mysql part of the install: coolestguyplanettech.com

    Note: I did the optional step: ... in order to use mysql commands without typing the full path to the commands you need to add the mysql directory to your shell path... as I've found doing so can help during builds, etc (some scripts assume...)

    Here, I tried to simply create a new rails app with the default database being mysql (which brought down mysql2 via bundler). From there - I tried to do a test app with a quick scaffold - and mysql2 barfed.

    From there I hit an error 'Library not loaded: libmysqlclient.16.dylib' and as noted here: stackoverflow awesomeness I added this line to my .profile: export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

    MY PATH included rails and ruby explicitly: /Users/gabriel/.rvm/gems/ruby-1.9.3-p194@rails327/bin:/Users/gabriel/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/gabriel/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/gabriel/.rvm/bin:/usr/local/mysql/bin:/usr/local/bin:/usr/bin:/usr/sbin:/opt/X11/bin:

    Hopefully, these resources will provide some additional help.

提交回复
热议问题