StandardError: An error has occurred, this and all later migrations canceled:
PG::InternalError: ERROR: could not load library "/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so, 10): Symbol not found: __ZN5boost7archive21basic_binary_iarchiveINS0_15binary_iarchiveEE13load_overrideERNS0_15class_name_typeEi
Referenced from: /usr/local/lib/libSFCGAL.1.dylib
Expected in: /usr/local/lib/libboost_serialization-mt.dylib
in /usr/local/lib/libSFCGAL.1.dylib
: CREATE EXTENSION IF NOT EXISTS "postgis"/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change'
-e:1:in `<main>'
ActiveRecord::StatementInvalid: PG::InternalError: ERROR: could not load library "/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so, 10): Symbol not found: __ZN5boost7archive21basic_binary_iarchiveINS0_15binary_iarchiveEE13load_overrideERNS0_15class_name_typeEi
Referenced from: /usr/local/lib/libSFCGAL.1.dylib
Expected in: /usr/local/lib/libboost_serialization-mt.dylib
in /usr/local/lib/libSFCGAL.1.dylib
: CREATE EXTENSION IF NOT EXISTS "postgis"
/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change'
-e:1:in `<main>'
PG::InternalError: ERROR: could not load library "/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.4.5/lib/postgis-2.1.so, 10): Symbol not found: __ZN5boost7archive21basic_binary_iarchiveINS0_15binary_iarchiveEE13load_overrideERNS0_15class_name_typeEi
Referenced from: /usr/local/lib/libSFCGAL.1.dylib
Expected in: /usr/local/lib/libboost_serialization-mt.dylib
in /usr/local/lib/libSFCGAL.1.dylib
/Users/harshamv/Sites/clink/db/migrate/20150812164615_enable_postgis.rb:3:in `change'
-e:1:in `<main>'
Am getting the above error all of sudden when i tried to drop and recreate my Rails-PostgreSQL
You probably recently upgraded the boost Homebrew formula doing a brew update / brew upgrade, and it seems the latest version is not playing well with postgis.
I fixed a very similar issue by going back to the previous version of boost with:
brew switch boost 1.58.0
UPDATE: now that this was fixed in Homebrew, the answer below suggesting to do a simple update / upgrade is probably the way to go. If you did switch previously, you can now brew switch boost 1.59.0 to upgrade to the latest version of boost, you might also have to brew reinstall postgis.
This issue has been fixed here. Re-install and it should work.
$ brew update && upgrade
$ brew install postgis
Couldn't find 1.58.0 either, but 1.55.0_1 is available and successfully installed postgis for me. These entries in effectif and stackoverflow were very helpful. The process may have extra steps.
Just to be sure:
$ brew uninstall postgis
Tap to homebrew versions, if not having it yet:
$ brew tap homebrew/versions
Find the newest available:
$ brew search boost
...
homebrew/versions/boost155
...
$ brew install homebrew/versions/boost155
This installs boost under a different formula (boost155). To be able to switch versions, I symlinked the old version to the boost directory:
$ ln -s /usr/local/Cellar/boost155/1.55.0_1 /usr/local/Cellar/boost/1.55.0_1
After this it is business as usual:
$ brew switch boost 1.55.0_1
$ brew install postgis
If you need to install a specific version of a formula, take a look at this thread:
Homebrew: install specific version of formula
I just ran into this problem as well, and version 1.56.0 of boostwas available and solved the issue for me. Looks like the problem is specifically with 1.58.0.
Related
I've recently acquired a macOs BigSur, unfortunately, I have had a lot of issues trying to install a Rails App. After some days coming over issues with forum answers, I have encountered an issue that I cannot solve and there's not too much on the internet about how to solve this.
Whenever I run the following command rails db:reset I get the following output:
dyld: lazy symbol binding failed: Symbol not found: _grpc_set_ssl_roots_override_callback
Referenced from: /Users/usr/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/grpc-1.38.0/src/ruby/lib/grpc/grpc_c.bundle
Expected in: flat namespace
dyld: Symbol not found: _grpc_set_ssl_roots_override_callback
Referenced from: /Users/usr/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/grpc-1.38.0/src/ruby/lib/grpc/grpc_c.bundle
Expected in: flat namespace
zsh: abort rails db:reset
I reviewed this Github issue https://github.com/grpc/grpc/issues/24846 and followed the steps marked by nilleb user to solve my first issue, but then I got into this error message which is also mentioned in the same thread but I couldn't find a way to solve it.
When I run gem list I get
grpc (1.38.0 ruby universal-darwin)
google-protobuf (3.17.3 ruby universal-darwin)
And my ruby version is
ruby 2.6.6p146 (2020-03-31 revision 67876) [-darwin20]
I read the posts made by the user premist but didn't know exactly what to do.
Could you please help me in this situation? I would really appreciate your help!
I have solved this problem. The issue was caused by my homebrew path, and I needed to install its folder in /usr/local/homebrew instead of /usr/opt/homebrew because /opt/homebrew is for ARM use (so I had to install with intel).
I uninstalled brew and all its tools such as rbenv, nvm, etc. Then, I installed brew again but with the arch flag x86_64 command: arch -x86_64 /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)\". After this, I installed rbenv, nvm, and other tools always using arch flag: arch -x86_64
can't install any gem
ERROR: Loading command: install (LoadError)
dlopen(/Users/MacBookPro/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
Referenced from: /Users/MacBookPro/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle
Expected in: /usr/local/lib/libssl.1.0.0.dylib
in /Users/MacBookPro/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle - /Users/MacBookPro/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Perhaps this problem has to do with a recent update of XCode. After a XCode update you need to do the following steps:
Open Xcode and accept the license agreement
Reinstall the Command Line Tools.
The second step seems to depend on your OS versions. Try xcode-select --install in your console. If that does not work try to start the Install Command Line Developer Tools app in /System/Library/CoreServices.
After reinstalling the Command Line Tools try to rerun bundle install.
I use OS X 10.9.4.
I wanted to install ruby-2.1.1 by rvm install 2.1.1
But I got some error. I checked the log and found that I must brew link libgpg-error first before I install libksba, But, when I execute the command brew link libgpg-error, I got an error message says Linking /usr/local/Cellar/libgpg-error/1.13... Error: No such file or directory - /usr/local/Cellar/libgpg-error/1.12/share/common-lisp, I checked the comment there, and found here is only libgpg-error/1.13, not libgpg-error/1.12. And I searched in the google search engine, Nothing could I found.
So, How should I do to successfully execute brew link libgpg-error?
Had similar error, fixed by brew prune. Based on https://github.com/Homebrew/homebrew/issues/32169
I'm on the Ruby track and I'm in the installation process of Ruby on Rails.
I'm trying to install gems but it's not happening and i'm not sure why and how to fix it.
$gem install bundler
ERROR: Loading command: install (LoadError)
dlopen(/Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64- darwin13.0/openssl.bundle
Reason: image not found - /Users/nthulanemakgato/.rbenv/versions/2.1.1/lib/ruby/2.1.0/x86_64-darwin13.0/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
Here is one of the solutions that i've tried:
$CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1
rbenv: /Users/nthulanemakgato/.rbenv/versions/2.1.1 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log
Last 10 log lines:
x yaml-0.1.6/win32/vc6/test_reader.dsp
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml- 0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl
BUILD FAILED
Inspect or clean up the working tree at /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140429120202.53716.log
Last 10 log lines:
x yaml-0.1.6/win32/vc6/run_loader.dsp
x yaml-0.1.6/win32/vc6/run_parser.dsp
x yaml-0.1.6/win32/vc6/example_reformatter_alt.dsp
x yaml-0.1.6/win32/vc6/example_deconstructor.dsp
x yaml-0.1.6/win32/vc6/libyaml.dsw
x yaml-0.1.6/win32/vc6/yaml.dsp
/var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716/yaml- 0.1.6 /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140429120202.53716 ~
configure: WARNING: unrecognized options: --with-openssl-dir
configure: error: expected an absolute directory name for --prefix: openssl
make: *** No targets specified and no makefile found. Stop.
I have openssl-1.0.1g installed
I'm using Mac 10.9.2
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]
rbenv 0.4.0-97-gfe0b243
This is not like other questions in that i'm using rbenv whereas others ask rvm related questions which I can't use.
Thanks in advance.
I found that although I already had openSSL installed I needed to brew upgrade ruby before it was recognized. Another maze of twisty little passages, all alike.
It looks like you need to install OpenSSL first.
So try to install it:
$ brew install openssl
And then you need to recompile ruby with OpenSSL:
$ CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1-p76
When I checked my
rbenv local
and
rbenv global
they we different.
So I set
rbenv local 2.6.5
and it resolved my issue
I saw a similar error out of nowhere too one day…
I just removed then reinstalled ruby, and the error was fixed.
try to use this code in cmd
chcp 1252
Ruby stopped working on my brother's machine recently.
gem commands
rails server
rails console
All failed with the following error:
$ irb
irb(main):001:0> require 'digest/sha1'
LoadError: dlopen(~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle, 9): Symbol not found: _rb_Digest_SHA1_Finish
Referenced from: ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
Expected in: flat namespace
in ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle - ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/x86_64-darwin12.2.0/digest/sha1.bundle
from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from ~/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from (irb):1
from ~/.rbenv/versions/2.0.0-p0/bin/irb:12:in `<main>'
He tried different versions of Ruby. Reinstalling everything with rvm. Running rvm implode and reinstalling rvm. Switching to rbenv. Several Rubies installed via ruby-build. brew install ruby.
All had the same problem.
If he uninstalled all rubies, the OS supplied version in /usr/bin/ruby worked. But it's 1.8.7.
After hours of troubleshooting, we arrived at the solution below. I hope it helps you avoid some pain.
Possible solutions:
$ unset C_INCLUDE_PATH and reinstall Ruby
This is the solution that worked for me.
$ echo $C_INCLUDE_PATH
If C_INCLUDE_PATH is set, it will break Ruby builds. Remove it from your environment; either temporarily with $ unset C_INCLUDE_PATH, or permanently (might be in .bashrc, .profile, .bash_profile); then reinstall ruby.
It might be related to OpenSSL, RVM, XCode's Command Line Tools (gcc), or other build issues.
See this answer if the previous solution didn't work.
For anyone, like me, coming here because of an error like this:
LoadError: dlopen(/Users/sebkomianos/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle, 9): Symbol not found: _SSLv2_client_method
Referenced from: /Users/sebkomianos/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/x86_64-darwin13.0.0/openssl.bundle
Expected in: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
One solution (taken from here) might be to reinstall your version of ruby. eg: rbenv install 2.0.0-p247