rubyonmac / rubyonmac-issues

Bug fixes and feature request tracking for Ruby on Mac.
https://www.rubyonmac.dev
3 stars 0 forks source link

configure: error: something wrong with LDFLAGS="-L/opt/homebrew/opt/ruby/lib" Configuration of ruby 3.1.2 failed! #5

Closed trev91 closed 2 years ago

trev91 commented 2 years ago

In which version of Ruby on Mac did you find the bug? Basic, Plus, or Prime?

PRIME

Describe the bug A clear and concise description of what the bug is.

On an M1 Mac, I ran the restart script, then continued on the normal mode to install everything. It was going great, but then failed.

Details about your Mac Before you ran the script for the first time, did you already have development tools like Homebrew installed, or did you run it on a fresh and clean macOS?

It had homebrew previously installed, but I cleaned it up.

Please attach the Ruby on Mac log file The log file will be called either rom-basic.log, or rom-plus.log, or rom-prime.log. You can find it in your Mac's Home folder.

Welcome to the Ruby on Mac Prime script!

You should be and up and running with a working Ruby environment in a few minutes.

Running Ruby on Mac in NORMAL mode...

The following lines are to help me debug any issues:

=================Start of debugging=====================

Current shell: /bin/zsh

Current PATH: /opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/opt/openssl@3/bin:/Users/trevor/.rbenv/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/openssl@1.1/bin:/opt/homebrew/opt/openssl@1.1/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/opt/openssl@3/bin:/Users/trevor/.rbenv/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/openssl@1.1/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/trevor/Library/Android/sdk/emulator:/Users/trevor/Library/Android/sdk/tools:/Users/trevor/Library/Android/sdk/tools/bin:/Users/trevor/Library/Android/sdk/platform-tools:/Users/trevor/Library/Android/sdk/emulator:/Users/trevor/Library/Android/sdk/tools:/Users/trevor/Library/Android/sdk/tools/bin:/Users/trevor/Library/Android/sdk/platform-tools

macOS version: ProductName: macOS ProductVersion: 12.3.1 BuildVersion: 21E258

Mac model: hw.model: MacBookPro18,3

Mac CPU: Apple M1 Pro

CPU architecture: arm64

=================End of debugging=====================

Checking if Homebrew is installed...

Homebrew already installed. Updating Homebrew... Already up-to-date.

Verifying the Homebrew installation... Your system is ready to brew.

Your Homebrew installation is good to go.

Found Brewfile-rom-prime in /Users/trevor/rubyonmac

Installing formulas from Brewfile-rom-prime... Using automake Using bison Using gdbm Using libffi Using libyaml Using openssl@1.1 Using readline Using chruby Using ruby-install Using git Using gh Homebrew Bundle complete! 11 Brewfile dependencies now installed.

All formulas were installed successfully.

Checking if a newer version of Ruby is available...

Installing latest stable Ruby version: 3.1.2

Installing ruby 3.1.2 into /Users/trevor/.rubies/ruby-3.1.2 ... Installing dependencies for ruby 3.1.2 ... Warning: automake 1.16.5 is already installed and up-to-date. To reinstall 1.16.5, run: brew reinstall automake Warning: bison 3.8.2 is already installed and up-to-date. To reinstall 3.8.2, run: brew reinstall bison Warning: openssl@1.1 1.1.1n is already installed and up-to-date. To reinstall 1.1.1n, run: brew reinstall openssl@1.1 Warning: readline 8.1.2 is already installed and up-to-date. To reinstall 8.1.2, run: brew reinstall readline Warning: libyaml 0.2.5 is already installed and up-to-date. To reinstall 0.2.5, run: brew reinstall libyaml Warning: gdbm 1.23 is already installed and up-to-date. To reinstall 1.23, run: brew reinstall gdbm Warning: libffi 3.4.2 is already installed and up-to-date. To reinstall 3.4.2, run: brew reinstall libffi Downloading https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.xz into /Users/trevor/src ... Verifying ruby-3.1.2.tar.xz ... Extracting ruby-3.1.2.tar.xz to /Users/trevor/src/ruby-3.1.2 ... Configuring ruby 3.1.2 ... checking for ruby... /usr/bin/ruby tool/config.guess already exists tool/config.sub already exists checking build system type... aarch64-apple-darwin21.4.0 checking host system type... aarch64-apple-darwin21.4.0 checking target system type... aarch64-apple-darwin21.4.0 checking for cl.exe... no checking for clang... clang checking for llvm-ar... no checking for clang++... clang++ checking for llvm-nm... no checking for llvm-objcopy... no checking for llvm-objdump... no checking for llvm-ranlib... no checking for llvm-strip... no checking for gcc... (cached) clang checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether clang accepts -g... yes checking for clang option to accept ISO C89... none needed checking for clang option to accept ISO C99... none needed checking whether we are using the GNU C++ compiler... yes checking whether clang++ accepts -g... yes checking how to run the C preprocessor... clang -E checking for ranlib... ranlib checking for gar... no checking for ar... ar checking for gas... no checking for as... as checking for gnm... no checking for nm... nm checking for gobjcopy... no checking for objcopy... no checking for gobjdump... no checking for objdump... objdump checking for gstrip... no checking for strip... strip checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking minix/config.h usability... no checking minix/config.h presence... no checking for minix/config.h... no checking whether it is safe to define EXTENSIONS... yes checking if minimum required OS X version is supported... yes checking whether the linker is GNU ld... no checking whether clang -E accepts -o... yes checking for clang... /usr/bin/clang checking for real target cpu... arm64 checking arch option... checking for ar flags... rcu checking whether ln -s works... yes checking whether make sets $(MAKE)... yes checking for a BSD-compatible install... /usr/bin/install -c checking for a thread-safe mkdir -p... -d use 'mkdir -p' as MKDIR_P checking for dtrace... dtrace checking for dot... no checking for doxygen... no checking for pkg-config... no checking whether it is Android... no checking for cd using physical directory... cd -P checking whether CFLAGS is valid... yes checking whether LDFLAGS is valid... no configure: error: something wrong with LDFLAGS="-L/opt/homebrew/opt/ruby/lib" !!! Configuration of ruby 3.1.2 failed! failed

monfresh commented 2 years ago

Hi @trev91. Thanks for buying Ruby on Mac!

After you ran the script in reset mode, did you add things back to your ~/.zshrc and/or ~/.zprofile?

From the log, I see that your PATH has some unexpected things in there. Can you please quit and restart your Terminal, then paste the result of these commands:

cat ~/.zshrc

and

cat ~/.zprofile
trev91 commented 2 years ago

I did not add anything back to either of those files. I restarted the terminal and this is the output:

trevor@MacBook-Pro ~ % cat ~/.zshrc

alias rom='cd ~/rubyonmac &&/usr/bin/env bash ~/rubyonmac/rom-prime 2>&1 | tee ~/rom-prime.log' trevor@MacBook-Pro ~ % cat ~/.zprofile

eval $(/opt/homebrew/bin/brew shellenv) trevor@MacBook-Pro ~ %

monfresh commented 2 years ago

Interesting. What happens if you run the script again with rom?

trev91 commented 2 years ago

Running again after closing and re-opening the terminal appears to have solved the issue. Perhaps a note could be included after the reset script completes to let the user know they may need to restart the terminal window?

Either way, excited to see how this goes. It appears to have completed running all the way through without any issues.

Thanks!

monfresh commented 2 years ago

Great! I'm glad it's working now.

It looks like you found a bug. Thank you for surfacing this. I will fix this tonight and upload a new version. I will probably exit the script after reset mode and let people know they should quit and restart and run rom.

trev91 commented 2 years ago

@monfresh Happy to have been helpful! Thanks for the useful tool! I think your idea is good. Running rom after a restart of the terminal window is simple enough. Perhaps explain that it helps ensure all the changes take effect prior to the normal installation. Either way, this is great. Thanks for a great tool.