Question

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?

Was it helpful?

Solution

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

OTHER TIPS

Just to mention – this issue has been fixed.
Built and installed today (10/13/2014) via $ brew install mongodb

==> Summary
🍺  /usr/local/Cellar/mongodb/2.6.5: 17 files, 331M, built in 21.6 minutes

If the steps described by Linus are not sufficient, perform the additional steps (10.10 beta 3 and beta 4):

  1. cd /Library/Caches/Homebrew/
  2. tar xvfz mongodb-2.6.3.tar.gz
  3. cd mongodb-src-r2.6.3
  4. vi src/third_party/s2/util/endian/endian.h
  5. Uncomment lines 181-189

    // This one is safe to take as it's an extension
    //#define htonll(x) ghtonll(x)
    //
    // ntoh* and hton* are the same thing for any size and bytesex,
    // since the function is an involution, i.e., its own inverse.
    //#define gntohl(x) ghtonl(x)
    //#define gntohs(x) ghtons(x)
    //#define gntohll(x) ghtonll(x)
    //#define ntohll(x) htonll(x)
    
  6. cd ..
  7. rm mongodb-2.6.3.tar.gz
  8. tar cvfz mongodb-2.6.3.tar.gz mongodb-src-r2.6.3
  9. brew install mongodb

    ==> Downloading http://downloads.mongodb.org/src/mongodb-src-r2.6.3.tar.gz
    Already downloaded: /Library/Caches/Homebrew/mongodb-2.6.3.tar.gz
    Error: SHA1 mismatch
    Expected: 226ab45e3a2e4d4a749271f1bce393ea8358d3dd
    Actual: 593bbe9cb7e0b1d2368b3b6487893e8ba459acfb
    Archive: /Library/Caches/Homebrew/mongodb-2.6.3.tar.gz
    
  10. Copy the actual SHA1
  11. brew edit mongodb
  12. Replace the expected SHA1 value with the actual one.
  13. brew install mongodb
  14. rm -rf mongodb-src-r2.6.3

Looks like a patch has been suggested. But I don't really have any info - https://groups.google.com/forum/#!topic/mongodb-user/KToczUct6BE

I would like to see it working as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top