Closed jmschneider closed 2 years ago
I was finally able to figure out a solution right after I created this issue. I updated my ~/.bundle/config
to:
BUNDLE_BUILD__MINI_PHONE: "--with-phonenumber-dir=/opt/homebrew/opt/libphonenumber --with-opt-dir=/opt/homebrew/opt/protobuf"
I'm not super familiar with how ruby handles linking and stuff for native extensions so there may be a better way but that finally worked for me.
I'm having the same issue. the build flags above did not help.
When using the build flags I get the following error: `In file included from mini_phone.cc:4: /opt/homebrew/opt/libphonenumber/include/phonenumbers/phonenumberutil.h:33:10: fatal error: 'absl/container/node_hash_set.h' file not found
@espen I was able to get mine working again by updating my ~/.bundle/config
to be:
BUNDLE_BUILD__MINI_PHONE: "--with-phonenumber-dir=/opt/homebrew/opt/libphonenumber --with-opt-dir=/opt/homebrew/opt/protobuf:/opt/homebrew/opt/abseil"
It would be nice if it just worked out of the box but hopefully that can at least get you up and running.
Fixed in v1.1.8 ❤️
I ran into this again when upgrading my Ruby installation. I am able to uninstall and reinstall mini_phone on Ruby 3.1.2, but not able to install it on 3.1.3. I get an error: "Undefined symbols for architecture arm64:".
~ $ asdf shell ruby 3.1.2
~ $ gem list mini_phone
*** LOCAL GEMS ***
mini_phone (1.1.8)
~ $ gem install mini_phone
Building native extensions. This could take a while...
Successfully installed mini_phone-1.1.8
1 gem installed
~ $ gem uninstall mini_phone
Successfully uninstalled mini_phone-1.1.8
~ $ gem install mini_phone
Fetching mini_phone-1.1.8.gem
Building native extensions. This could take a while...
Successfully installed mini_phone-1.1.8
1 gem installed
~ $ asdf shell ruby 3.1.3
~ $ gem install mini_phone
Building native extensions. This could take a while...
ERROR: Error installing mini_phone:
ERROR: Failed to build gem native extension.
current directory: .asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/mini_phone-1.1.8/ext/mini_phone
.asdf/installs/ruby/3.1.3/bin/ruby -I .asdf/installs/ruby/3.1.3/lib/ruby/3.1.0 extconf.rb
checking for -lphonenumber... yes
creating Makefile
current directory: .asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/mini_phone-1.1.8/ext/mini_phone
make DESTDIR\= sitearchdir\=./.gem.20221211-41922-ck0afm sitelibdir\=./.gem.20221211-41922-ck0afm clean
current directory: .asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/mini_phone-1.1.8/ext/mini_phone
make DESTDIR\= sitearchdir\=./.gem.20221211-41922-ck0afm sitelibdir\=./.gem.20221211-41922-ck0afm
compiling mini_phone.cc
linking shared-object mini_phone/mini_phone.bundle
Undefined symbols for architecture arm64:
"google::protobuf::internal::LogMessage::LogMessage(google::protobuf::LogLevel, char const*, int)", referenced from:
void google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom<google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler>(google::protobuf::internal::RepeatedPtrFieldBase const&) in mini_phone.o
"google::protobuf::internal::LogMessage::~LogMessage()", referenced from:
void google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom<google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler>(google::protobuf::internal::RepeatedPtrFieldBase const&) in mini_phone.o
"google::protobuf::internal::LogMessage::operator<<(char const*)", referenced from:
void google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom<google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler>(google::protobuf::internal::RepeatedPtrFieldBase const&) in mini_phone.o
"google::protobuf::internal::GenericSwap(google::protobuf::MessageLite*, google::protobuf::MessageLite*)", referenced from:
i18n::phonenumbers::PhoneNumber::Swap(i18n::phonenumbers::PhoneNumber*) in mini_phone.o
"google::protobuf::internal::LogFinisher::operator=(google::protobuf::internal::LogMessage&)", referenced from:
void google::protobuf::internal::RepeatedPtrFieldBase::MergeFrom<google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler>(google::protobuf::internal::RepeatedPtrFieldBase const&) in mini_phone.o
"google::protobuf::internal::ArenaStringPtr::Set(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, google::protobuf::Arena*)", referenced from:
google::protobuf::internal::ArenaStringPtr::Set(char const*, google::protobuf::Arena*) in mini_phone.o
"google::protobuf::internal::RepeatedPtrFieldBase::DestroyProtos()", referenced from:
google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::~RepeatedPtrField() in mini_phone.o
"google::protobuf::internal::RepeatedPtrFieldBase::InternalExtend(int)", referenced from:
google::protobuf::internal::RepeatedPtrFieldBase::MergeFromInternal(google::protobuf::internal::RepeatedPtrFieldBase const&, void (google::protobuf::internal::RepeatedPtrFieldBase::*)(void**, void**, int, int)) in mini_phone.o
"google::protobuf::internal::RepeatedPtrFieldBase::AddOutOfLineHelper(void*)", referenced from:
google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add<google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler>(google::protobuf::RepeatedPtrField<i18n::phonenumbers::NumberFormat>::TypeHandler::Type const*) in mini_phone.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mini_phone.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in .asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/mini_phone-1.1.8 for inspection.
Results logged to .asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/extensions/arm64-darwin-22/3.1.0/mini_phone-1.1.8/gem_make.out
This seems to be a different issue so I created https://github.com/ianks/mini_phone/issues/13
I just upgraded to a M1 Pro mac and I've been having trouble getting this to work. Homebrew installs
libphonenumber
fine but when I runbundle install
I get the "It looks like libphonenumber is not installed on this system" message. I tried adding both of the following (one at a time) to my~/.bundle/config
to help it find the library:In both cases, I got the following: