Ruby Install failed on MacBook Pro M1 - ruby

Am trying to install Ruby on MacBook M1 but it failed every time,
Command used: rvm install ruby 2.7.2 (none of the version worked)
Error running '__rvm_make install',
please read /Users/myName/.rvm/log/1641910054_ruby-2.7.2/install.log
There has been an error while running make install. Halting the installation.
And after checking logs, I found
*** Following extensions are not compiled:
gdbm:
Could not be configured. It will not be installed.
Check ext/gdbm/mkmf.log for more details.
openssl:
Could not be configured. It will not be installed.
Check ext/openssl/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
I have also tried other version managers like asdf but no luck.
Background: HomeBrew installed successfully, paths also set, rvm also installed. Command line tools for Xcode also installed, using latest version of Xcode 13.2.1 and latest macOS Monterey 12.1.

I think maybe rvm just doesnt work properly on m1 yet? Try just using brew install ruby for now. It should work the same.

Related

how to install ruby-Tk on mac OSX catalina 10.15.4, ruby-2.6.3

Please could anyone help me with the best step by step instruction to install ruby-Tk on mac OSX catalina 10.15.4 running ruby-2.6.3. doing
gem install tk
gives me this error. "Can't find "tk.h". Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk." Thanks
Below guide assumes you have Xcode already installed. If not install it first from the apple app store.
1) Install ActiveTcl for macOS from https://www.activestate.com
under applications/utilities, there will be a new app wish.app. run this app and if you get the wish console to open, then, it installed ok
2) Using your command line do the following
brew install ruby #this will install latest version of ruby
gem install tk
3) then add other ruby gems that you need for your development environment.

Updating Ruby Mac OS 10.6.8 Snow Leopard

I'm trying to install a more recent version of Ruby on Snow Leopard so I can install Jekyll. When trying to install any version of Jekyll I get an error saying that it requires liquid, which requires ruby v2+.
If I try upgrade via rbenv I get the following when trying all versions:
error: failed to download ruby-2.1.1.tar.bz2
BUILD FAILED (OS X 10.6.8 using ruby-build 20181019)
I've also installed Ruby manually from source but this isn't recognised by the system and I can't switch versions.
If i run rbenv global it only recognises the System version of Ruby.
When I try brew upgrade ruby I get the following error:
ruby 2.5.3_1 already installed
If I try link to the new version with brew I get the following error:
brew link --force --overwrite ruby#2.5.3_1
Error: No such keg: /usr/local/Cellar/ruby#2.5.3_1
RVM doesn't install so I'm not sure what to do next. Below are the details of the packages I have installed.
Xcode 3.2.2 (I cant get an installer working for any higher versions of Xcode). The more recent versions hosted by Apple for Snow Leopard are corrupt when downloaded.
rbenv 1.1.1
brew 1.8.4
ruby 1.8.7 (System)
You have (or had) a path issue. Before you did your follow up steps, if you had run which ruby you'd probably see it pointing to /usr/bin/ruby which is system ruby, not your homebrew ruby in /usr/local/bin/ruby.
You still need to, if you haven't already, add your export command to your ~/.bash_profile file to ensure your PATH gets updated for every terminal window you open.
I'm not sure what actually fixed this but I ran the following commands after reading other posts and now have Jekyll 3.8.3 installed and ruby 2.5.3p105.
sudo chown -R "$USER":admin /usr/local
export PATH=/usr/local/bin:$PATH
brew link --overwrite ruby --force
gem install jekyll

Trying to install ruby 2.1.2 with rbenv on OSX BUILD FAILED

So, as the title suggests, I'm trying to install ruby 2.1.2, altough I've tried to install other versions as well, and I'm getting the same errors. I'm running OSX 10.9.2.
I've tried:
Installing a fresh gcc compiler, via brew install gcc47
Installing updated OSX command line tools
Uninstalling rbenv and trying again
Restarting the machine
Here is the sum of what I'm getting:
rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb4 25589e6635
Installing ruby-2.1.2...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728
Results logged to /var/folders/6c/h_82199n12515_hd3rcp2x5w0000gn/T/ruby-build.20140528115901.38728.log
Last 10 log lines:
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
compiling miniinit.c
compiling miniprelude.c
translating probes probes.d
compiling bignum.c
compiling class.c
dtrace: failed to compile script probes.d: Preprocessor not found
make: *** [probes.h] Error 1
make: *** Waiting for unfinished jobs....
compiling compar.c
Thoughts?
Gist of verbose output
I was able to build it using:
CONFIGURE_OPTS="--disable-dtrace" rbenv install 2.1.2
Basically that's what is suggested in the question's comment by wicz.
The solution by KurtPreston did not work for me. Also using OS X 10.9.
I was able to get this working in my own environment by:
Removing the gcc installed by Homebrew: brew remove gcc47
Re-installing the XCode Command Line Tools from the XCode Downloads page at https://developer.apple.com/downloads
I was trying to install 2.0 and ran into the same error. However now the CONFIGURE_OPTIONS override doesn't seem to work anymore with rvm at least, so I needed to build it with rvm install --reconfigure -C --disable-dtrace ruby-2.0.0-p594. This was the first Google result off the error message ("dtrace: failed to compile script probes.d: Preprocessor not found") so I figured I should add this as a current solution for rvm users. Running on OSX Mavericks.
I cannot reproduce this on my machine, sorry. For reference, here's my dtrace version if that should have anything to do with the error:
dtrace -V
dtrace: Sun D 1.7
You can try to check for XCode and command line tools updates. GCC 4 should not be necessary, you can use the compiler that ships with XCode:
brew uninstall gcc4
Finally, update everything and try again:
brew update
brew upgrade rbenv ruby-build
rbenv uninstall 2.1.2
rbenv install 2.1.2
If that does not work yet: some people have reported that a simple reboot of the machine solved similar errors with dprobe/dtrace.

Ruby on Rails install trouble on OSX with dependencies

I'm trying to install RoR on Mountain Lion. I have the following installed:
Xcode from the App Store with command line tools
RVM
homebrew
In terminal I verified that gcc is installed.
When I type in "rvm requirements" I get a message saying that I'm missing a number of dependencies including OpenSSL, autoconf, automake, libxslt and many more. RVM also says to install these with brew. So I do and rvm no longer complains about the missing dependencies.
But when I try to install ruby 1.9.3 via "rvm install 1.9.3", at the end of the compile I receive a message "ruby was built using clang -but it's not (fully) supported, expect errors."
I'm stumped at this point. I'm trying to figure out:
Why are dependencies missing when I've installed Xcode command line tools?
Why am I still getting a compile error after using brew to install the dependencies?
Help please. :)
Try using gcc compiler instead i.e
rvm install 1.9.3 --with-gcc-4.2
Reference: https://github.com/wayneeseguin/rvm/issues/1480
So here's the order I usually go through before installing any Rubies.
1st thing: Install XCode and the Command Line Tools for Mountain Lion (you can also install these from the Preferences > Downloads window).
2nd: Make sure you have Homebrew installed.
3rd: Once that's set up, run brew tap homebrew/dupes
4th: Then brew install openssl autoconf apple-gcc42 automake
I had issues with RVM and have long since switched to RBenv/Ruby-Build. There are various differences, but really running through the above steps should fix any issues you had, and lots of people use one or the other. Both are great.
Then, just try to install Ruby however you choose to.

Error compiling ruby 1.9.3 using rvm, homebrew, or macports

I've tried installing ruby 1.9.3 using rvm, using homebrew, and using macports and all seem to fail part way through the compile. I'm using Lion OSX.
Here is the log file of my most recent attempt using rvm
http://pastebin.com/AEiJbGzD
Any help would be appreciated. It all started when I started getting openssl errors so tried uninstalling openssl and re-installing it. Openssl installed with no issue but then I couldn't get ruby re-installed.
Thanks
I was able to install Ruby 1.9.3 on Lion and Xcode 4.2 using rvm with the --with-gcc=clang flag:
$ rvm install 1.9.3 --with-gcc=clang
You should install OSX GCC installer:
GitHub - OSX GCC Installer
After installation you run:
CC=/usr/bin/gcc-4.2 rvm install 1.9.3
And it should work.
Or you can change permanently:
export CC=/usr/bin/gcc-4.2
rvm install 1.9.3
Xcode 4.2 doesn't install non-LLVM gcc anymore.
I have had this problem after reinstall mountain lion (clean install) and after install XCode 5 DP... I have followed the steps and installed Command Line Tools from Xcode/Preferences... and had having the same problem.
I have been checking https://developer.apple.com/downloads/index.action?=command%20line%20tools and installed "Command Line Tools (OS X Mountain Lion) for Xcode - April 2013" after that, everything works fine.
Regards

Resources