I am working on a Ruby on Rails application in a Mac M1 machine. Previously I was able to build this same application while on Ruby 2.5.5 and mysql2 0.5.1 (both in arm64), but an upgrade happened and now when I run bundle exec rails server I get this error:
require': dlopen(/vendor/bundle/ruby/2.6.0/extensions/-darwin-21/2.6.0/mysql2-0.5.3/mysql2/mysql2.bundle, 0x0009): symbol not found in flat namespace (\_mysql_affected_rows) - /vendor/bundle/ruby/2.6.0/extensions/-darwin-21/2.6.0/mysql2-0.5.3/mysql2/mysql2.bundle (LoadError)\
So far I've:
Verified both the Ruby 2.6.4 and mysql installed are on arm64
(I used brew and rbenv, checked path is correct- brew --prefix mysql returns /opt/homebrew/opt/mysql)
Tried setting different bundle config (mysql#5.7 and mysql#8.0)
For example, in .bundle/config I added:
BUNDLE_BUILD__MYSQL2: "--with-mysql-lib=/opt/homebrew/opt/mysql#8.0/lib --with-mysql-dir=/opt/homebrew/opt/mysql#8.0 --with-mysql-config=/opt/homebrew/opt/mysql#8.0/bin/mysql_config --with-mysql-include=/opt/homebrew/opt/mysql#8.0/include --with-ldflags=-L/opt/homebrew/opt/mysql-client#8.0/lib --with-cppflags=-I/opt/homebrew/opt/mysql-client#8.0/include"
I also tried running:
gem install mysql2 -v '0.5.3' -- --with-mysql-lib=/usr/local/opt/mysql#8.0/lib --with-mysql-dir=/usr/local/opt/mysql#8.0 --with-mysql-config=/usr/local/opt/mysql#8.0/bin/mysql_config --with-mysql-include=/usr/local/opt/mysql#8.0/include --with-ldflags=-L/usr/local/opt/mysql-client#8.0/lib --with-cppflags=-I/usr/local/opt/mysql-client#8.0/include
Delete /vendor/bundle/ruby/2.6.0 folder (which has all dependencies) and redo bundle install
Re-install Ruby 2.6.4 arm64
Re-install mysql arm64
After all these attempts I still run into the same load error ><
I had a similar problem with my Mac M2 due to installing MySQL 5.7 with Homebrew for ARM. Here are the steps I followed to fix it in case it can help someone:
Access terminal with Rosetta:
close terminal completely
navigate to Applications > Utilities > Terminal
Ctrl-Click and select "Get Info"
tick on "Open using Rosetta"
Open terminal and install Homebrew for x86_64: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Add aliases:
switch architecture between ARM and x86_64
echo 'alias arm="env /usr/bin/arch -arm64 /bin/zsh --login"' >> ~/.zshrc
echo 'alias intel="env /usr/bin/arch -x86_64 /bin/zsh --login"' >> ~/.zshrc
use brew for ARM and brew for x86_64
echo 'alias mbrew='arch -arm64e /opt/homebrew/bin/brew'' >> ~/.zshrc
echo 'alias ibrew='arch -x86_64 /usr/local/bin/brew'' >> ~/.zshrc
Close terminal completely, uncheck "Open using Rosetta" and reopen terminal again
mbrew remove mysql#5.7
intel
ibrew install mysql#5.7
gem install mysql2 -v x.x.x -- --with-mysql-config=/usr/local/opt/mysql#5.7/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl#1.1/lib --with-cppflags=-I/usr/local/opt/openssl#1.1/include
You can now return to the ARM console by running arm, close terminal completely and tick "Open using Rosetta" again...
I am trying to install Kframework without success. I installed all the dependencies following instructions at https://github.com/kframework/k/tree/master#prerequisite-install-guide and updated the environment variables as suggested.
I have export PATH="~/z3-4.8.7-x64-osx-10.14.6/bin:$PATH" .
I am running:
brew uninstall kframework
brew uninstall z3, and uninstall the version installed outside of brew
brew clean && brew update && brew upgrade
brew install z3 kframework
Brew install kframework produces the following warning about Command Line Tools:
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
and eventually ends with
<<< ERROR!
143 org.kframework.utils.errorsystem.KEMException: [Error] Critical: Could not start z3 pr ocess (IOException: Cannot run program "z3": error=2, No such file or directory)(Even though my CLT are up to date and installed in the right place ).
My CommanLineTools seem legit. I have Xcode Version 11.3.1 (11C505),
and have installed CommanLineTools from a binary I downloaded from apple development site Command_Line_Tools_for_Xcode_11.3.1.dmg
Typing "xcode-select -p" gives
/Library/Developer/CommandLineTools
my z3 is : z3 -version
Z3 version 4.8.7 - 64 bit (binary downloaded from z3 website) .
I tried this also with Z3 version 4.8.12
Any advice appreciated.
I'm using Mac OS for development. Now I'm developing an app using Blockcypher API. With Ruby on Rails, when I try to send money using the Gem, it always return this error
FFI::NotFoundError (Function 'OPENSSL_init_ssl' not found in [libssl.dylib])
Already try to upgrade or downgrade the OpenSSL version on my mac but nothing happend and it so frustating. My friend on linux doesn't get this error, work perfectly on his device. Has anyone ever got this error?
I had the same problem, after research for one day I found the solution for rvm ruby-2.7.2 version:
Install openssl version 1.1:
brew update & brew upgrade & brew install openssl#1.1
cd in your openssl lib folder in my case: /usr/local/opt/openssl#1.1/lib
copy files to /usr/lib
cd /usr/local/opt/openssl#1.1/lib
Copy the libssl.1.1.dylib file
sudo cp libssl.1.1.dylib libcrypto.1.1.dylib /usr/local/lib/
make softlink
sudo ln -s libssl.1.1.dylib libssl.dylib
sudo ln -s libcrypto.1.1.dylib libcrypto.dylib
Reinstall ruby with openssl version:
rvm reinstall 2.7.2 --with-openssl-dir=/usr/local/opt/openssl#1.1
References github issues, stackoverflow.
Zucchini framework seems a promising candidate for quality assurance of iOS user interfaces.
However, the installation steps provided on their website assume that most of the prerequisites already exist OR that one is already familiar with the intricacies of command line.
I would like to know what requires to be installed before I can successfully install and use zucchini framework on Mac OSX.
Requirements
Zucchini framework has the following requirements:
Ruby >= 1.9.3
Xcode >= 4.2 (for this installation process we require Xcode >= 4.6.2)
Xcode command line tools
Nodejs
Coffee script (node module)
How to install
Install Homebrew
$> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update Homebrew
$> brew update
Install imagemagick and nodejs
$> brew install imagemagick node
Install coffee script module for nodejs
i. Install coffee script
$> npm install coffee-script
ii. Add coffee bin to your PATH environment variable
$> cd ~
$> sudo vim .bash_profile
Press i, to switch into insert mode then add following line
PATH=$PATH:$HOME/node_modules/coffee-script/bin
Press :w to save and
Press :q to quit vim
Now relaunch the terminal.
iii. Verify that coffee script is successfully installed.
At the prompt
$> coffee
To exit from coffee script type following at the coffee> prompt:
process.exit()
Install command line tools for Xcode
Install and/or update ruby (if its less than 1.9.3)
i. ruby is installed on Mac OSX by default, verify using the following command:
$> ruby -v
ii. Install rvm (Ruby version manager)
$> \curl -L https://get.rvm.io | bash -s stable --rails
--autolibs=enabled
iii. Add rvm bin directory to path variable
$> sudo vim .bash_profile
Insert the following line, save and quit
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Relaunch the terminal.
iv. Update ruby to 1.9.3 or later
$> rvm install 1.9.3
Install zucchini
$> gem install zucchini-ios
NOTE: I have included the reference for each step from where I got help during installation.
I'm stuck trying to install rails on my mac. I have OS X 10.6.8 and I have confirmed that I have Ruby, version 1.8.7
I ran sudo gem update and sudo gem update --system to get the latest versions of the software.
However, when I run sudo gem install rails I get this error:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/json-1.6.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
If you have XCode 4 or later you will need to open it and go to Preferences -> Downloads -> Components and install the Command Line tools as they aren't installed by default. Couldn't install Rails until this happened.
Im using osx 10.10. You can download from the command-line
xcode-select --install
Not sure what it needs to compile, but OSX can't compile any native ruby extensions at all unless the Apple developer tools are installed. On 10.7 Lion you can download it free from the app store, or Download it here for 10.6: http://developer.apple.com/xcode/index.php
It may also be on your OSX install discs, though probably much more out of date.
Did you install the OS X developer tools? You'll need to do this to be able to build native extensions
Just a follow up ...
it may be that you are on a mac and rails cannot find the right compiler for c headers.
just install xcode from apps store / homebrew or go to terminal ...
$ xcode-select --install
complete the installation and agree on the licensing etc, then ...
$ sudo gem install rails
There are two possible reasons for the fail:
PRIMARY REASON: Missing Xcode Command Line Tools
Verifying Xcode Command Line Tools Installation manually:
Check for presence of
"/usr/include/iconv.h" (if absent=>Missing or improperly installed Xcode CLT)
Installing Xcode CLT:
Try running xcode-select --install on terminal and follow the instructions. If it fails, open Xcode.app, select from menu "Xcode" - "Open Developer Tool" - "More Developer Tools" to open the developer site, download the installer for your OS version and run it.
SECONDARY REASON(if 1. fails): Version issues
Try upgrading the ruby version using rbenv.
Hope it helps!
Steps to sort out this issue:
Follow these steps unless error is fixed.
Open terminal and run commands:
sudo xcode-select --install
sudo xcodebuild -license accept
Make sure you have installed only one Xcode and it is the latest one. If more than one version is installed then keep only the latest one with name in applications like Xcode.app
Open Xcode->preferences->locations then check if any command line tools are selected; if not then select
Install Ruby by:
brew install ruby
Install CocoaPods by
sudo gem install cocoapods
Try to install Ruby via RVM. I solved in this way
How to install ruby on Ubuntu with rvm
The Command line tools didn't solve this issue for me.
I upgraded ruby installation through rbenv to 2.2.0, made that the global default ruby installation, and this issue was fixed.
Switch Ruby to Homebrew version:
$ brew install ruby
$ brew link --overwrite ruby
$ echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
$ echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
$ echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile
Just had a similar issue. I can confirm that installing the command line tools fixes it.
https://stackoverflow.com/a/58226876/8070378
Solved after run:
sudo xcode-select --install
sudo xcodebuild -license accept
I had this problem on macOS Catalina 10.15.7, and it seems that Xcode 12.3's Ruby is a variant of 2.6, but my software needed 2.7.
I installed rvm and ran rvm install ruby-2.7, and now it works just fine 🎉