Trouble reinstalling MongoDB with Homebrew using OS X 10.10 Yosemite Beta

joshferrara picture joshferrara · Jun 5, 2014 · Viewed 10.7k times · Source

To reiterate, I'm running the first OS X 10.10 beta, and attempting to reinstall MongoDB with Homebrew.

After running $ brew install mongodb, this is the output:

==> Downloading http://downloads.mongodb.org/src/mongodb-src-r2.6.1.tar.gz
==> /usr/local/opt/scons/bin/scons install --prefix=/usr/local/Cellar/mongodb/2.6.1 -j8 --cc=/usr/bin/clang --cxx=/usr/bin/clang++ --osx-version-min=10.10 --full --64
scons: Reading SConscript files ...
Mkdir(".scons/Darwin/nohost")
usage: scons [OPTION] [TARGET] ...

SCons Error: option --osx-version-min: invalid choice: '10.10' (choose from '10.6', '10.7', '10.8', '10.9')

Obviously the install package isn't configured for 10.10 because it isn't released to the public yet.

Is there a way to manually bypass this during the build process?

Answer

Linus Unnebäck picture Linus Unnebäck · Jun 13, 2014

This will probably be fixed in newer versions of MongoDB (https://jira.mongodb.org/browse/SERVER-14204), for now simply patch the formula.

brew edit mongodb

Find the block that looks like this:

args = %W[
  --prefix=#{prefix}
  -j#{ENV.make_jobs}
  --cc=#{ENV.cc}
  --cxx=#{ENV.cxx}
  --osx-version-min=#{MacOS.version}
]

And change the OS X version min to 10.9, like so:

args = %W[
  --prefix=#{prefix}
  -j#{ENV.make_jobs}
  --cc=#{ENV.cc}
  --cxx=#{ENV.cxx}
  --osx-version-min=10.9
]

EDIT: Extra step for DP3, DP4, PB1

Still in the file, add the following 3 lines just above def install.

  def patches
    { :p1 => 'https://gist.githubusercontent.com/LinusU/a1771562fec0201c54cd/raw/98825f9fbe93b8cc524e05a9c0e99864e8301731/mongodb.diff' }
  end

And then perform upgrade:

brew upgrade mongodb