Domanda

Quando faccio bundle install, ottengo errore seguente:

Installing mysql2 (0.3.10) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/manish/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/manish/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
--with-mysql-config
--without-mysql-config
extconf.rb:33:in ``': No such file or directory - /usr/local/bin/mysql_config --cflags    (Errno::ENOENT)
from extconf.rb:33:in `<main>'


Gem files will remain installed in /Users/manish/.rvm/gems/ruby-1.9.2-p290/gems/mysql2- 0.3.10 for inspection.
Results logged to /Users/manish/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-  0.3.10/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.3.10), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.10'` succeeds before bundling.

Nel Gemfile MySql è qualcosa di simile:

gem "mysql2", ">=0.3.0"

E quando cerco anche di installare MySQL utilizzando birra seguito con sudo dà errore seguente:

 sudo: unable to execute /usr/local/bin/brew: Permission denied

Come posso risolvere questo?

È stato utile?

Soluzione

Ho trovato la mia soluzione e qui è:

Passaggio 1: Clean Up tuo rvm precedentemente installato e Xcode

    => rm -rf ~/.rvm    
    => sudo rm -rf /Developer

Passaggio 2:. Installare Xcode da App Store o il programma di installazione si salvi nel vostro Launchpad

Passaggio 3: Installare HomeBrew:

    => mkdir -p /usr/local/Cellar
    => /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

Passaggio 4: Installazione RVM

    => bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    => echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" #  Load RVM function' >> ~/.bash_profile

Passo 5: installare Ruby 1.9.2

    => rvm install 1.9.2
    => rvm use ruby-1.9.2 --default
    => gem install rails thin bundler
    => rvm install 1.9.2-head
    => brew install git ack wget curl redis memcached libmemcached colordiff imagemagick

Passo 6: installare MySQL

    => brew install mysql
    => mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
    => mkdir -p ~/Library/LaunchAgents
    => cp /usr/local/Cellar/mysql/5.5.15/com.mysql.mysqld.plist ~/Library/LaunchAgents/
    => launchctl load -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
    => mysql -u root
    => UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
    => FLUSH PRIVILEGES;

Altri suggerimenti

È possibile scaricare le librerie e passare la loro posizione manualmente il processo di costruzione gemma come le bandiere, ma questo è un po 'di dolore.

MySQL stava comportando ricerca di in / usr / local / bin, che ha senso per un homebrew installazione ma se sudo birra non funziona, c'è un problema di autorizzazioni e siete probabilità di avere molto più problemi a venire.

mi piacerebbe risolvere brew onestamente b / c che continuerà a vanificare. danza Normale a fix -. riparare i permessi utilizzando Disk Utitlity, correre medico birra per verificare la presenza di problemi, implode e reinstallare se le cose vanno male

In bocca al lupo

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top