How do i point to an older keg with homebrew? - homebrew

I have the following:
kamil:~/Sites/sc-1.9.3#sc: (develop)$ brew info mongo
mongodb: stable 2.2.0-x86_64
http://www.mongodb.org/
/usr/local/Cellar/mongodb/2.0.1-x86_64 (18 files, 120M)
/usr/local/Cellar/mongodb/2.2.0-x86_64 (20 files, 170M) *
I want to run 2.0.1 again, but everything points to newest version:
kamilski81:~/Sites:ruby-1.9.3:$ ll /usr/local/bin/mongod
kamilski81 wheel 41 Sep 22 13:55 /usr/local/bin/mongod -> ../Cellar/mongodb/2.2.0-x86_64/bin/mongod
Is there an eloguent way to point to the older version of mongo?

Use the brew switch:
$ brew switch mongo 2.0.1

Related

Rails 7, vips on M1 MacBook Air

I'm unable to use Rails 7.0.3.1 with vips on an M1 MacBook Air due to the error:
rails aborted!
LoadError: Could not open library 'glib-2.0.0': dlopen(glib-2.0.0, 0x0005): tried: 'glib-2.0.0' (no such file), '/usr/local/lib/glib-2.0.0' (no such file), '/usr/lib/glib-2.0.0' (no such file), '/Users/brody/Code/tms.next-tms.com.wip2/glib-2.0.0' (no such file).
Could not open library '/opt/local/lib/libglib-2.0.0.dylib': dlopen(/opt/local/lib/libglib-2.0.0.dylib, 0x0005): tried: '/opt/local/lib/libglib-2.0.0.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
I'm using ffi 1.15.1 and can see it searching correctly in /opt/local/lib, but the homebrew package builds binaries for x86_64 rather than arm64e even while using the --build-from-source option (brew install vips --build-from-source).
Has anyone got this working?
I ran into the same issue (with libglib-2.0.0) but then I figured that brew poured glib--2.74.5.arm64_monterey.bottle so why does it find 2.0.0? In my case it was (a dated version of) Navicat linking an old glib
~$ ls -l /usr/local/lib/libglib*
0 lrwxr-xr-x 1 chaos staff 73B Dec 11 11:23 /usr/local/lib/libglib-2.0.0.dylib -> /Applications/Navicat Premium.app/Contents/Frameworks/libglib-2.0.0.dylib
This wasn't the only file however, Navicat linked a total of 71 dylib files. I removed all those symlinks and then the error disappeared

brew update fails at PHP7.4 step

Looking for help with a failing brew upgrade.
I'm running macOS Monterey version 12.4 on a MacStudio system. I've been running homebrew applications (notably php7.4) for a good while now. I noticed that it reported that 30 packages could be updated, so I ran:
brew update
brew upgrade
The upgrade step failed with (excerpts from log shown here):
Warning: php#7.4 has been deprecated because it is a versioned formula!
Warning: Building httpd from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://dlcdn.apache.org/httpd/httpd-2.4.54.tar.bz2
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/0630b06c782baa4fd4809e1322ebb1439d78dfa0cde375669da966f5da5718cd--httpd-2.4.54.tar.bz2
==> Installing php#7.4 dependency: httpd
==> ./configure --enable-layout=Slackware-FHS --prefix=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54 --sbindir=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/bin --mandir=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/share/man --sysconfdir=/Volumes/Satechi.SSD.M2/homebrew/etc/httpd --datadir=/Volum
==> make
==> make install
Error: An exception occurred within a child process:
Utils::Inreplace::Error: inreplace failed
/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/lib/httpd/build/config_vars.mk:
expected replacement of #<Pathname:/Volumes/Satechi.SSD.M2/homebrew/Cellar/pcre2/10.40> with #<Pathname:/Volumes/Satechi.SSD.M2/homebrew/opt/pcre2>
The things I notice here that might be related to the problem, are the fact a specific version of PHP (7.4) was installed (I must keep this version)... and a vague mention of my unusual path.
Since it may be related: before I installed brew, ran these commands in an effort to minimize the use of the precious .5TB primary drive:
mkdir /Volumes/Satechi.SSD.M2/homebrew/
ln -fs /Volumes/Satechi.SSD.M2/homebrew/ /opt/homebrew
ln -fs /Volumes/Satechi.SSD.M2/homebrew /homebrew # (I no longer remember why I created this link - except that it was to solve some forgotten problem)
So my brew home is technically not in the same filesystem as opt, but the default path to brew's folders (/opt/homebrew/*) continues to work. This is what I want, and it's been working for a few months. Not sure this is related to the problem but I thought I'd point it out in case.
The full output of brew upgrade is:
dennis#macstudio:/opt/homebrew 07/05 07:49:56
> brew update
Already up-to-date.
dennis#macstudio:/opt/homebrew 07/05 07:50:02
> brew upgrade
==> Upgrading 30 outdated packages:
libtiff 4.3.0 -> 4.4.0
ffmpeg 5.0.1 -> 5.0.1_3
nettle 3.7.3 -> 3.8
freetype 2.12.0 -> 2.12.1
openjpeg 2.4.0 -> 2.5.0
speex 1.2.0 -> 1.2.1
harfbuzz 4.2.1 -> 4.3.0
glib 2.72.1 -> 2.72.2
libxcb 1.14_2 -> 1.15
aom 3.3.0 -> 3.4.0
srt 1.4.4 -> 1.5.0
unixodbc 2.3.9_1 -> 2.3.11
ninja 1.10.2_1 -> 1.11.0
meson 0.62.1 -> 0.63.0
curl 7.83.0 -> 7.84.0
php#7.4 7.4.29 -> 7.4.30
krb5 1.19.3 -> 1.20
libvpx 1.11.0 -> 1.12.0
freetds 1.3.10 -> 1.3.12
dav1d 0.9.2 -> 1.0.0
libpq 14.2 -> 14.4
oniguruma 6.9.7.1 -> 6.9.8
x264 r3060 -> r3095
unbound 1.15.0 -> 1.16.0
libzip 1.8.0_1 -> 1.9.2
openldap 2.6.1 -> 2.6.2
libass 0.15.2 -> 0.16.0
libx11 1.7.5 -> 1.8.1
python#3.9 3.9.12 -> 3.9.13_1
gnutls 3.7.4 -> 3.7.6
Warning: Building openldap from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/195208ba31cadc265ea97bb8aad4e78caab1200daf4d855e6c839b5f987f92db--configure-big_sur.diff
==> Downloading https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.2.tgz
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/9e06aa4612038dd6b4686ef4e738b0853be6cca0bcd7b673c7f8d436c4731162--openldap-2.6.2.tgz
==> Downloading https://ghcr.io/v2/homebrew/core/curl/manifests/7.84.0
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/a65075db232ffcd42c8fbf1258bbd0fc1a8b6affe5f8b4eba2a880127e336f48--curl-7.84.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/curl/blobs/sha256:00b2bfb12b8fd68992872941d19f8c38971cfb7f6c34fe72ebb014b8110ebc07
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/12b262a44d04f8246b961c8b41690618bde0c3e912025ae860b5cca763160812--curl--7.84.0.arm64_monterey.bottle.tar.gz
Warning: Building unixodbc from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading http://www.unixodbc.org/unixODBC-2.3.11.tar.gz
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/01fd783738abfafd6c8cec4df80068e73cf5ff4aea30c8e2c71767de6678f8e4--unixODBC-2.3.11.tar.gz
Warning: Building freetds from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/195208ba31cadc265ea97bb8aad4e78caab1200daf4d855e6c839b5f987f92db--configure-big_sur.diff
==> Downloading https://www.freetds.org/files/stable/freetds-1.3.12.tar.bz2
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/c17aff1bdcced723dd942325b7e7e96b7c1e70b5dc7e889514036b2b9821272d--freetds-1.3.12.tar.bz2
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/manifests/2.12.1
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/908428437764929aa268ec3967d2d4c58d2c0cdcb971555c98cd45ab6b7e3368--freetype-2.12.1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/freetype/blobs/sha256:3e190f2fa02702aa86e46cf33e7dde1d93e879f1de38f3d1b61e301f8367136d
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/047bc186da41bb1af4be21bed67fd89fc1402bc8e893c48fcc39633181777ffe--freetype--2.12.1.arm64_monterey.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/libtiff/manifests/4.4.0
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/b37cf6c170f1c01d5757e2494de5d65c9b117306a86f9e29f28e57b1a9972191--libtiff-4.4.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libtiff/blobs/sha256:d2dfbad3fe68e070d0937c71b4de6ca110dda32599a2adfc2272f31064ae8652
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/a26e660ed5b116421a6dbb7550c38769a2c1ee3619e4e05202768cc1d729446e--libtiff--4.4.0.arm64_monterey.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/aom/manifests/3.4.0
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/960cdcf340a08fc2ed5f16d2cbf7d2d3f5dc110b4df0df159926aca746a43dc6--aom-3.4.0.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/aom/blobs/sha256:f16849b3bb161a0695d5bb6677799f4d87e1db60fbaf6719f1ea0a996847d029
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/43a851ccf4d3e7785b9d60744a279305b22b7c9a3102cd4554c1ad7220f81df1--aom--3.4.0.arm64_monterey.bottle.tar.gz
Warning: Building krb5 from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://kerberos.org/dist/krb5/1.20/krb5-1.20.tar.gz
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/6e2ebcecfb4893ac77e1724a4492e77dc53193c679df6fa9f44f0641aa0e185f--krb5-1.20.tar.gz
Warning: Building libpq from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://ftp.postgresql.org/pub/source/v14.4/postgresql-14.4.tar.bz2
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/5fc4b1e478c7edc04305eadc9285da556aeac65cc3987ea8651fc0f00468f95e--postgresql-14.4.tar.bz2
==> Downloading https://ghcr.io/v2/homebrew/core/libzip/manifests/1.9.2
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/cb899c2a5c3111ed02fd5b8b5130aa6b6f66f2bf4ad5f2f15bd8537ea3c09ed2--libzip-1.9.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libzip/blobs/sha256:e27a1b53f6b09e0bb04071f66d878ef4594dbc3fde6e27a0b644d33a8ce34e0a
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/7c926e61bd610fa04fdd139f61f1b17f482485581586e0f685a3a3482192da12--libzip--1.9.2.arm64_monterey.bottle.tar.gz
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/manifests/6.9.8
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/fccf013b32eda50ffdfbb2748b9f01c7d5a845d5ba02bfeed201b6a30028800c--oniguruma-6.9.8.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/oniguruma/blobs/sha256:6c66f5d4198bfd9d9be019f4f40d19f4c68676df9eb0702f450ec818ef43d3e9
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/7d6a5f7cd1a97384adefddfb9d93988a5483cba45514e16df22b6022d7bf4f13--oniguruma--6.9.8.arm64_monterey.bottle.tar.gz
Warning: php#7.4 has been deprecated because it is a versioned formula!
Warning: Building httpd from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /Volumes/Satechi.SSD.M2/homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /Volumes/Satechi.SSD.M2/homebrew)
==> Downloading https://dlcdn.apache.org/httpd/httpd-2.4.54.tar.bz2
Already downloaded: /Users/dennis/Library/Caches/Homebrew/downloads/0630b06c782baa4fd4809e1322ebb1439d78dfa0cde375669da966f5da5718cd--httpd-2.4.54.tar.bz2
==> Installing php#7.4 dependency: httpd
==> ./configure --enable-layout=Slackware-FHS --prefix=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54 --sbindir=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/bin --mandir=/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/share/man --sysconfdir=/Volumes/Satechi.SSD.M2/homebrew/etc/httpd --datadir=/Volum
==> make
==> make install
Error: An exception occurred within a child process:
Utils::Inreplace::Error: inreplace failed
/Volumes/Satechi.SSD.M2/homebrew/Cellar/httpd/2.4.54/lib/httpd/build/config_vars.mk:
expected replacement of #<Pathname:/Volumes/Satechi.SSD.M2/homebrew/Cellar/pcre2/10.40> with #<Pathname:/Volumes/Satechi.SSD.M2/homebrew/opt/pcre2>
I ran "brew doctor" with the following output: (We can ignore the error about brew not being in the path. I had removed it from PATH as a troubleshooting step before this step.)
dennis#macstudio:/opt/homebrew/bin 07/05 07:36:29
> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
php#7.4
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/homebrew/bin/pkg-config
/homebrew/bin/freetype-config
/homebrew/bin/libpng16-config
/homebrew/bin/libpng-config
/homebrew/bin/pspell-config
/homebrew/bin/python3.9-config
/homebrew/bin/onig-config
/homebrew/bin/python3-config
/homebrew/bin/pcre2-config
/homebrew/bin/pcre-config
/homebrew/bin/sdl2-config
/homebrew/bin/guile-config
Warning: Your Cellar and TEMP directories are on different volumes.
macOS won't move relative symlinks across volumes unless the target file already
exists. Brews known to be affected by this are Git and Narwhal.
You should set the "HOMEBREW_TEMP" environment variable to a suitable
directory on the same volume as your Cellar.
Warning: Your Homebrew's prefix is not /opt/homebrew.
Some of Homebrew's bottles (binary packages) can only be used with the default
prefix (/opt/homebrew).
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
unsupported configuration.
Warning: /usr/bin occurs before /Volumes/Satechi.SSD.M2/homebrew/bin in your PATH.
This means that system-provided programs will be used instead of those
provided by Homebrew. Consider setting your PATH so that
/Volumes/Satechi.SSD.M2/homebrew/bin occurs before /usr/bin. Here is a one-liner:
echo 'export PATH="/Volumes/Satechi.SSD.M2/homebrew/bin:$PATH"' >> ~/.kshrc
The following tools exist at both paths:
python3
pip3
tidy
Warning: Homebrew's "bin" was not found in your PATH.
Consider setting your PATH for example like so:
echo 'export PATH="/Volumes/Satechi.SSD.M2/homebrew/bin:$PATH"' >> ~/.kshrc
Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /Volumes/Satechi.SSD.M2/homebrew/sbin.
Consider setting your PATH for example like so:
echo 'export PATH="/Volumes/Satechi.SSD.M2/homebrew/sbin:$PATH"' >> ~/.kshrc
Here is the output of 'brew config':
> brew config
HOMEBREW_VERSION: 3.5.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: 88a5fac96752f17280e64f60926f58dff45990e0
Last commit: 8 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: edf3b15659f8130f2c6f4b8db62bc84c444c095d
Core tap last commit: 8 days ago
Core tap branch: master
HOMEBREW_PREFIX: /Volumes/Satechi.SSD.M2/homebrew
HOMEBREW_REPOSITORY: /Volumes/Satechi.SSD.M2/homebrew
HOMEBREW_CELLAR: /Volumes/Satechi.SSD.M2/homebrew/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 13.1.6 build 1316
Git: 2.32.1 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.4-arm64
CLT: 13.4.0.0.1.1651278267
Xcode: N/A
Rosetta 2: false
I don't understand enough about brew to begin diagnosing his problem, beyond what I've done here. Any help?

Travis-CI - chrome 62 instead of 77

For two days Travis CI returns version 62 of chrome instead of 77, do you also have the problem on your CI / CD?
.travis.yml (source)
addons:
chrome: stable
trace: (source)
$ export CHROME_SOURCE_URL=https://dl.google.com/dl/linux/direct/google-chrome-stable_current_amd64.deb
Installing Google Chrome stable
1.17s$ wget --no-verbose -O /tmp/$(basename $CHROME_SOURCE_URL) $CHROME_SOURCE_URL
2019-09-11 15:41:31 URL:https://dl.google.com/dl/linux/direct/google-chrome-stable_current_amd64.deb [62302944/62302944] -> "/tmp/google-chrome-stable_current_amd64.deb" [1]
dpkg-deb: error: archive '/tmp/google-chrome-stable_current_amd64.deb' has premature member 'control.tar.xz' before 'control.tar.gz', giving up
dpkg: error processing archive /tmp/google-chrome-stable_current_amd64.deb (--install):
subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
/tmp/google-chrome-stable_current_amd64.deb
Google Chrome 62.0.3202.94
I add install dpkg
.travis.yml:
addons:
apt:
packages:
- dpkg
chrome: stable
It's a known bug with the dpkg package not supporting xz compressed packages and latest versions of Chrome apparently use it.
The best solution would be to upgrade to dist: xenial build env since trusty are quire old now. Or update the package I guess.
See https://github.com/travis-ci/travis-ci/issues/9361
Changing the Linux distribution fixed the issue for me.
Change:
dust: trusty
To:
dist: xenial
In the .travis.yml file, change my Chrome version from 62.0.3202.94 to 81.0.4044.138
I fixed it on our opensource project by forcing dpkg reinstall:
https://github.com/PrestaShop/PrestaShop/pull/15581

dart pub get fails to resolve dependencies

Version: 1.30.0 (system setup)
Commit: c6e592b2b5770e40a98cb9c2715a8ef89aec3d74
Date: 2018-12-11T22:29:11.253Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
OS: Windows_NT x64 6.1.7601
Dart VM version: 2.1.0-dev.9.4.flutter-f9ebf21297
(Thu Nov 8 23:00:07 2018 +0100) on "windows_x64"
[Dart_Reformatter] pub get
Resolving dependencies...
The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.
Because Dart_Reformatter depends on stagehand >=3.1.4 which requires SDK version >=2.1.0 <3.0.0, version solving failed.
exit code 1
I'm not sure what I need to do to fix this.
You need to install a version of Dart (or Flutter) where the Dart SDK is >=2.1.0 – in semver, 2.1.0-dev... is < 2.1.0.
Try flutter upgrade?

Segmentation fault when compiling mysql2 with mingw

When I try to create a Rails server this is what I get. It instantly runs over 500+ lines of code and comes back with this message. This is my first Ruby on Rails project. I am pretty new to coding as well. Would love some help if possible. Thank you!
C:/Ruby200-x64/lib/ruby/gems/2.0.0/extensions/x64-mingw32/2.0.0/mysql2-0.3.15/my
sql2/mysql2.so: [BUG] Segmentation fault
ruby 2.0.0p451 (2014-02-24) [x64-mingw32]
0 enumerator.so
1 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/encdb.so
2 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/iso_8859_1.so
3 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/trans/transdb.so
4 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/rbconfig.rb
5 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb
6 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb
7 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb
8 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb
9 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/version.rb
10 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
11 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/platform.rb
12 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/basic_specification.rb
13 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/stub_specification.rb
14 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/util/stringio.rb
15 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb
16 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/exceptions.rb
17 C:/Ruby200-x64/lib/ruby/2.0.0/rubygems/defaults/operating_system.rb
18 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/utf_16le.so
19 C:/Ruby200-x64/lib/ruby/2.0.0/x64-mingw32/enc/trans/utf_16_32.so
20 C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
537 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_sup
port/core_ext/module.rb
538 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_view/r
ecord_identifier.rb
539 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_view/h
elpers/record_tag_helper.rb
540 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_view/h
elpers/rendering_helper.rb
541 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_view/h
elpers/translation_helper.rb
542 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/actionpack-4.0.0/lib/action_view/h
elpers.rb
543 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sprockets-rails-2.0.1/lib/sprocket
s/rails/helper.rb
544 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/engine/co
nfiguration.rb
545 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/applicati
on/configuration.rb
546 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/sprockets-rails-2.0.1/lib/sprocket
s/railtie.rb
547 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/all.rb
548 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0/lib/active_sup
port/string_inquirer.rb
549 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2/version.r
b
550 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.15/lib/mysql2/error.rb
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
C:\Users\MVParker\Documents\Sites\simple_cms>
Following the answer from Dave Schweisguth, about the ruby bug, and doing the steps described by Heesob Park's comment, I could get mysql2 gem to work. Thank you guys for sharing this.
Quote from Heesob comment:
The libmysql.lib included in the MySQL Connector/C 64 bit is not
compatible with the mingw64-gcc compiler.
You need to generate mingw64 compatible libmysql.lib file.
To create an compatible libmysql.lib file, I did the following steps:
(I'm running Win8.1 x64 with Ruby 2.0.0p481 [x64-mingw32])
1) Downloaded this zip file https://structure-svm-map.googlecode.com/files/svm-map-win.zip and extracted it to a c:\tmp\svm-map
2) Downloaded Mysql C/Connector 6.1 from http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-6.1.3-winx64.zip and extracted it to c:\tmp\mysql
3) Open CMD Prompt
4) cd \tmp\svm-map\python-mingw-lib
5) gendef.exe \tmp\mysql\lib\libmysql.dll
6) move libmysql.def \tmp\mysql\lib
7) cd \tmp\mysql\lib
8) \Ruby200-x64\DevKit\mingw\bin\dlltool -v --dllname libmysql.dll --def libmysql.def --output-lib libmysql.lib
9) gem install mysql2 -- --with-mysql-dir=c:\tmp\mysql
That´s it! Mysql2 gem running on Rails x64 on Windows 8.1! =)
I googled "x64-mingw32 mysql2 Segmentation fault" and found this: https://bugs.ruby-lang.org/issues/8591
Looks like there is a bug in mysql2. A comment on the Ruby issue gives a workaround, regenerating libmysql.lib with your compiler. Please report back and let us know if it works.

Resources