memongo icon indicating copy to clipboard operation
memongo copied to clipboard

Memongo doesn't work Apple M1 Silicon

Open anuj-kumar opened this issue 3 years ago • 1 comments

I'm trying to use memongo for application testing on Apple M1 chipset. On running the test, it throws the following error:

panic: memongo does not support automatic downloading on your system: your architecture, arm64, is not supported
anuj ~> go version
go version go1.17.5 darwin/arm64

anuj-kumar avatar Dec 24 '21 09:12 anuj-kumar

Two things:

  1. This can be solved by specifying the download URL when running on M1:
opts := &memongo.Options{
	MongoVersion: "5.0.0",
}
if runtime.GOARCH == "arm64" {
	if runtime.GOOS == "darwin" {
		// Only set the custom url as workaround for arm64 macs
		opts.DownloadURL = "https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-5.0.0.tgz"
	}
}
mongoServer, err := memongo.StartWithOptions(opts)
  1. Notice that this repo is no longer active, see https://github.com/benweissmann/memongo/issues/12

shlomi-dr avatar Mar 23 '22 21:03 shlomi-dr