Re: Building Ruby gems with MacPorts Ruby

2022-01-08 Thread Fang-Pin Chang
My recommendation is to install rbenv using MacPorts.  Then you can either 
install ruby-build either using MacPorts or as a plugin to rbenv, and then 
install the versions of Ruby you want locally (outside of MacPorts), like so:

$ rbenv install 3.0.3
$ rbenv install 3.1.0

If you want to dive deeper, also install the rbenv-gemset plugin to have 
control over project-specific gems.

—

> On Jan 2, 2022, at 12:17 PM, Joshua Root  wrote:
> 
>> It appears that the ruby31 port is missing something, as I can install 
>> ruby30, switch to it with sudo port select --set ruby ruby30, then install 
>> gems no problem.
> I just had a look and ruby31 is indeed doing something wrong. Here's the 
> ticket I filed: 
> 
> - Josh
> 



Re: Building Ruby gems with MacPorts Ruby

2022-01-02 Thread Joshua Root

It appears that the ruby31 port is missing something, as I can install ruby30, 
switch to it with sudo port select --set ruby ruby30, then install gems no 
problem.
I just had a look and ruby31 is indeed doing something wrong. Here's the 
ticket I filed: 


- Josh



Re: Building Ruby gems with MacPorts Ruby

2022-01-02 Thread Andreas Yankopolus
It appears that the ruby31 port is missing something, as I can install ruby30, 
switch to it with sudo port select --set ruby ruby30, then install gems no 
problem.

> On Jan 2, 2022, at 1:48 PM, Andreas Yankopolus  wrote:
> 
> All—
> 
> I’ve installed Ruby with sudo port install ruby31 and want to install 
> middleman  with sudo gem install middleman. This 
> gives an error that header files for building gems are not present in 
> /opt/local/lib/ruby3.1/include:
> 
> Building native extensions. This could take a while...
> ERROR:  Error installing middleman:
>   ERROR: Failed to build gem native extension.
> 
> current directory: 
> /opt/local/lib/ruby3.1/gems/3.1.0/gems/ffi-1.15.4/ext/ffi_c
> /opt/local/bin/ruby3.1 -I /opt/local/lib/ruby3.1/3.1.0 -r 
> ./siteconf20220102-15848-cuiju7.rb extconf.rb
> mkmf.rb can't find header files for ruby at 
> /opt/local/lib/ruby3.1/include/ruby.h
> 
> You might have to install separate package for the ruby development
> environment, ruby-dev or ruby-devel for example.
> 
> extconf failed, exit code 1
> 
> Gem files will remain installed in 
> /opt/local/lib/ruby3.1/gems/3.1.0/gems/ffi-1.15.4 for inspection.
> Results logged to 
> /opt/local/lib/ruby3.1/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/ffi-1.15.4/gem_make.out
> 
> What MacPorts package(s) do I need for installing these headers? I’ve had no 
> luck searching on https://ports.macports.org/  
> for ruby.h
> 
> Cheers,
> 
> Andreas