Cannot port install Ruby - ruby

I am having trouble installing ruby through mac ports. The error that I am receiving is this one:
:error:extract org.macports.extract for port ruby returned: command execution failed
:debug:extract Error code: NONE
:debug:extract Backtrace: command execution failed
while executing
"$procedure $targetname"
:info:extract Warning: targets not executed for ruby: org.macports.activate
Can anyone help with this error? So far I have tried doing:
port -v selfupdate
xcodebuild -license agree
Neither of those seemed to fix my target issue.
Anyone have other tips?

I am not experienced using macports, and would rather prefer homebrew over it, at the moment.
However, to install Ruby (or specific versions of Ruby), I would really recommend using rbenv or RVM.
It seems that you are new to ruby, and if that is the case, I would further advice you to use rbenv over RVM. You will find it more pleasant, at the moment. Just my 2 cents.

To fix this problem what I had to do was go to the MacPorts webpage, download the new Mavericks MacPorts package, and run through that installation. I thought that doing a port -v selfupdate would update my current MacPorts to the Mavericks OS MacPorts but unfortunately it did not.

Related

Shopify CLI not recognising correct ruby install

When logging into a store with Shopify CLI I am given the following error:
"Your environment Ruby version, 2.6.3, is outside of the range supported by the CLI, 2.6.6..<3.2.0, and might cause incompatibility issues."
I am getting a general 'unexpected' error on a range of commands and believe it's due to the issue above. Thing is, I have latest ruby installed via homebrew, so it seems Shopify CLI is seeing another install.
I have tried reinstalling shopify-cli through homebrew using
brew reinstall shopify-cli
But this doesn't help.
If I run
ruby -v
I get the version mentioned in the error which shopify cli is seeing: "ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin21]"
Not sure if you fixed this, but I figured it out using this tool. Run brew config command, and look for the CLT: key: If it says >14.x, then you got an update from macOS v12.6 version. Please correct me if you think I might be wrong.
Just like a plus, update your Node package at least to v18.x. I hope that helps.

Using ruby-gems and compass on OS X + macports

Want use compass & sass and some "gems" for the compass.
I know nothing about the ruby and his ecosystem, and honestly - i need only the running compass watch - nothing more.
Because don't want touch the system-wide installed ruby, want use the macport's one.
I'm already using the macports for many packages, of course have the all OS X developer packages installed (Xcode + command line tools), therefore this question isn't a duplicate to this one.
Could please someone write how to use the macport's compass?
Already did:
$ sudo port install ruby
$ port select --list ruby
Available versions for ruby:
none (active)
ruby18
so activated the macports one
$ sudo port select --set ruby ruby18
ok, now the type ruby return /opt/local/bin/ruby. So, installed the rb-rubygems package
sudo port install rb-rubygems
but the type gem still returns /usr/bin/gem :(
also installed
$sudo port install rb-compass
but the compass command is still /usr/bin/compass - simply terrible.
So, please - could someone give an advice how to activate and use the whole macports ruby-suite? Some step-by-step guide would be nice. I simply need:
compass (+ some gems for the compass)
sass (needs it the compass)
ruby
gem
and whatever else what is needed for the compass.
Ps: i haven't problem with any other macport's packages - only the "ruby+macport logic" is somewhat unclear for me.
MacPorts avoids installing stuff in places that could also be used by the same software using different ruby versions. For this reason, rb-compass does not install to /opt/local/bin/compass where you would expect it. It does, however, install the compass executable in a couple of places you could use directly, add to your path, or symlink from /opt/local/bin/compass:
$ port contents rb-compass | grep -E 'compass(-1.8)?$'
/opt/local/bin/compass-1.8
/opt/local/lib/ruby/gems/1.8/bin/compass
/opt/local/lib/ruby/gems/1.8/gems/compass-0.12.2/bin/compass
/opt/local/libexec/ruby1.8/compass

Ruby error on OS X Yosemite and chef

Getting this error when trying to install chef on OS X Yosemite, other gems have installed fine. Not seeing a requirement. Just wondering if anyone has and idea of what the issue is or has come across this.
$sudo gem install chef
Building native extensions. This could take a while...
ERROR: Error installing chef:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20141023-4708-6api21.rb extconf.rb
creating Makefile
/Library/Ruby/Gems/2.0.0/gems/libyajl2-1.1.0/ext/libyajl2
extconf.rb:104:in `makemakefiles': unhandled exception
from extconf.rb:138:in `<main>'
extconf failed, exit code 1
EDIT: Although my answer below will help you install it on the system version of Ruby. I would probably suggest using RVM instead as the comment below mentions. I do not use Ruby very often and it would probably be fine, but I decided to take the 10 mins to change it to installing to RVM since that way I leave the system ruby untouched.
As I was searching across the web, I could actually resolve this issue (which also appeared on docker/ubuntu) as suggested in this thread:
https://stackoverflow.com/a/32191707/1948319
Long story short: The gmp library is missing. You can install it on ubuntu with
sudo apt-get install libgmp3-dev
I had this problem with this gem specifically, and another gem with c extensions as well.
Turns out I needed to accept new terms & conditions after updating XCode :-)
sudo xcodebuild -license
So I actually answered my own question very shortly after I posted and I hope it helps someone else in the future.
I used this instead:
$ sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install chef
The Apple LLVM compiler in Xcode treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
Came across this issue which was similar enough:
https://github.com/FontCustom/fontcustom/issues/194

gen update rake -bash: gen: command not found

I have installed Ruby, Rails, RVM, Git, and Homebrew on my Mac with OS X 10.7. I have also installed Jewelry box and have the following versions of Ruby installed: (1.9.1, 2.0.0).
I can go to a terminal window and perform a gem list command but when I try gem update rake I get the following error:
-bash: gen: command not found
I fear in all my installing, uninstalling and installing I have somehow gotten a confused environment due to possibly a conflict between a single user install and a multi-user install and do not know how to figure it out.
A whereis of Ruby and Rails show them both being in usr/bin.
There is no such command gen - try gem, it is possible you might have an alias gem=gen or function gem(){ gen "$#"; } which could make that happen

Can't enter Umlauts in Ruby 1.9.3 IRB

I am experiencing very strange behavior in Ruby 1.9.3's IRB with Mac OS 10.7.3
When I try to enter an Umlaut, it's escaped in the prompt and looks like this (I entered "ΓΌ" on the keyboard)
irb(main):001:0> "\U+FFC3\U+FFBC"
What's super strange is this:
irb(main):001:0> "\U+FFC3\U+FFBC".length
=> 0
Of course, the character isn't displayed either:
irb(main):001:0> "\U+FFC3\U+FFBC"
=> ""
Does anyone know what's going on here or how to fix this?
Victor Moroz didn't quite give the definitive answer but his link led me to a solution (thx!):
I forgot to mention:
Im running homebrew
I built ruby using ruby-build and this recipe (1.9.3-p125-perf, with falcon patches)
What I then did to solve this problem in my case was to recompile, this time pointing ruby to a more recent version of readline (6.2.2 in my case) that I installed with homebrew.
The steps it took were:
$ brew install readline
$ export CPPFLAGS=-I/usr/local/Cellar/readline/6.2.2/include
$ export LDFLAGS=-L/usr/local/Cellar/readline/6.2.2/lib/
$ curl https://raw.github.com/gist/1688857/rbenv.sh | sh && rbenv global 1.9.3-p125-perf
I ran across this problem as well, but my Ruby was built with rvm rather than ruby-build. I'd also previously used Homebrew on Mountain Lion to run other package installers, and among them got Readline 6.2.5 or something like that. This turns out to be the cause of this issue for me. So here's the fix:
From the RVM site:
If you have an error when compiling pertaining to readline, you may need to attempt installing with the procedure defined below.
$ rvm pkg install readline
$ rvm reinstall 1.9.2 --with-readline-dir=$rvm_path/usr
Note that this error occurs most often when having a MacPorts, Fink, or Homebrew installed readline on your system.
Hope this helps someone else!
This may help http://henrik.nyh.se/2008/03/irb-readline
UPDATE In fact on my Mac I have no problem with port version of Ruby, but original Mac OS version does have this problem (never used that one). So the easiest way is probably just to install Ruby from ports.
this command solved it for me:
brew install readline
RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 1.9.3-p286
source: https://github.com/rbenv/ruby-build/wiki

Resources