Error installing mysql2: Failed to build gem native extension

后端 未结 27 3142
清酒与你
清酒与你 2020-11-22 08:06

I am having some problems when trying to install mysql2 gem for Rails. When I try to install it by running bundle install or gem install mysq

27条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 09:06

    Got the "You have to install development tools first." error when trying to install the mysql2 gem after upgrading to Mac OS X Mountain Lion. Apparently doing this upgrade removes the command line compilers.

    To fix:

    • I uninstalled my very old version of Xcode (ran the uninstall script in /Developer/Library). Then deleted the /Developer directory.
    • Went to the AppStore and downloaded Xcode.
    • Launched Xcode and went into the Preferences -> Downloads, and installed the command line tools.

提交回复
热议问题