I can't install eventmachine gem on mac m1 - ruby

I got a new m1 mac and I can't install eventmachine gem, full log below.
I tried these solutions:
Install gem eventmachine 1.2.7 with ssl on m1
eventmachine does not compile with ruby 3.0.0preview1 on macOS · Issue #932 · eventmachine/eventmachine
same error.
some info:
$ sw_vers
ProductName: macOS
ProductVersion: 12.2
BuildVersion: 21D49
$ bundle --version
Bundler version 2.1.4
and the error:
$ gem install eventmachine -v '1.2.7'
em.cpp:706:13: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
if ((ret = rb_thread_select(kqfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
^~~~~~~~~~~~~~~~
rb_thread_fd_select
Full output: https://gist.github.com/goldylucks/8369ea09af4f3f70d707809f4bb700df
any ideas how to solve this?

I solved this (thanks to this tweet) with the following:
gem install eventmachine -v '1.2.7' -- --with-ldflags="-Wl,-undefined,dynamic_lookup"

what solved it for me was installing ruby like this:
$ arch -x86_64 rbenv install 2.5.5 # or using rvm

Related

Error installing Sass (Ruby 2.5.0.1, MSYS2 20161025.0.0)

I tried to install Sass. I installed Ruby and MSYS2 prior to that, the latest from all with Chocolatey:
choco install ruby
choco install msys2
Seemingly they were properly installed. ruby -v results in:
ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32]
When I tried to run gem install sass I received the following error message:
ERROR: Error installing sass:
The last version of ffi (< 2, >= 0.5.0) to support your Ruby & RubyGems was 1.9.18. Try installing it with `gem install ffi -v 1.9.18` and then running the current command again
ffi requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.
Ok, so I attempted to run gem install ffi -v 1.9.18.
I received this error message:
ERROR: Error installing ffi:
The last version of ffi (= 1.9.18) to support your Ruby & RubyGems was 1.9.18. Try installing it with `gem install ffi -v 1.9.18`
ffi requires Ruby version < 2.5, >= 2.0. The current ruby version is 2.5.0.
I tried to reinstall Ruby with proper installer, restarted computer, but the same error appears.
How can I make Sass to get installed?
To install the Ruby version before 2.5 (as mentioned in the comments):
choco install ruby --version 2.4.3.1

OS X Yosemite : Impossible to install cocoapods

I have ruby version : ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
When I try install cocoapods i get :
$ sudo gem install cocoapods -V
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/latest_specs.4.8.gz)
GET https://api.rubygems.org/prerelease_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/prerelease_specs.4.8.gz
200 OK
GET https://api.rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
ERROR: Possible alternatives: cocoapods
Someone to help me solve this?
It appears that at this day HomeBrew has few issues with OSX Yosemite.
I solved my issue by deleting ruby using the command :
brew uninstall ruby
and then installing rvm and ruby again with RVM:
curl -L https://get.rvm.io | bash -s stable --ruby
rvm rubygems latest
then gem install cocoapods worked like a charm !
brew install ruby
can do the work too, after that
sudo gem install cocoapods
It did worked in my yosemite

Ruby 1.92 and Mountain Lion

I just upgraded to Mountain Lion and had to install Xcode 4.4 (4.1 would not work). I believe this adversely affected my Ruby install, and more specifically Sass.
When I type $ sass --version I get the following error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in 'report_activate_error': Could not find RubyGem sass (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in 'activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in 'gem'
from /usr/bin/sass:18
Any ideas? I am running ruby 1.9.2p320 (2012-04-20 revision 35421)
What I ended up doing was:
$ source ~/.bashrc
And then I did:
$ gem install sass --pre
And that worked. When I do $ sass -v it reports Sass 3.2.0.alpha.275and not the error message above.

Error installing ruby-debug/ruby-debug-base with Ruby Enterprise v1.8.7

I got problems when trying to install gem ruby-debug-ide. Then, I try to install gem ruby-debug-base first. However, I got an error:
Error installing ruby-debug-base:
rb-threadframe requires Ruby version ~> 1.9.2frame.
The same error occured when installing ruby-debug.
I'm using Ubuntu v10.4, Ruby Enterprise v1.8.7, Rubygems v1.8.15.
Thanks for your help!
The problem is in new version (0.0.6) of rbx-require-relative that requires rb-threadframe >= 0
Try this:
gem install rbx-require-relative -v 0.0.5
gem install linecache ruby-debug-base --ignore-dependencies
Seems pretty self explanatory.
You need a Ruby version greater than 1.9.2 and you have v1.8.7, will need to get a newer version.

Error installing ScrAPI gem: ffi requires Ruby version >= 1.9.2

I am having issues installing the ScrAPI gem:
ERROR: Error installing scrapi:
ffi requires Ruby version >= 1.9.2.
I am running RVM and if I do ruby -v I get:
ruby -v
ruby 1.9.2p110 (2010-12-20 revision 30269) [i686-linux]
I am guessing you did
$ sudo gem install scrapi
sudo ruby -v
Unless you followed Wayne's sudo RVM install I'm guessing root uses a different ruby.

Resources