conda-forge / ruby-feedstock

A conda-smithy repository for ruby.
BSD 3-Clause "New" or "Revised" License
1 stars 24 forks source link

Document how to compile native extensions #44

Open phil-blain opened 4 years ago

phil-blain commented 4 years ago

To install gems with native extensions with the Ruby from this feedstock, the conda-forge compilers must be installed in the environment with

conda install -c conda-forge compilers

This is not obvious for beginner conda-forge users, and beginner Ruby users. It would be good to document this somewhere.

One idea is to use $PREFIX/.messages.txt so that upon installing the ruby package, we output a message like

To install gems with native extensions, you need the conda-forge compilers in your environment.

Provided the conda-forge channel is properly configured with strict priority, you can install the compilers with:

    conda install compilers

That would be the easiest way at the moment, I think. But then this message is automatically removed by conda after installation is finished, so it's not that great because users have no easy way to see this message again.

What would be easier is if conda had a conda info <package> command, like Homebrew does (which shows the "Caveats" section that are also shown at the end of installation).

Another idea is to mention it in the README of the feedstock, but this has a lot less visibility for users.

We could also add a section to the User documentation at conda-forge.github.io talking about the need to install the conda-forge compilers to install packages with natives extensions from another package management ecosystem that you install from conda-forge.

Originally posted by @phil-blain in https://github.com/conda-forge/ruby-feedstock/pull/18#issuecomment-649886178

kojix2 commented 1 year ago

I think it should be included in REAME.md.

iandol commented 4 months ago

I tried swtiching from rbenv to pixi and immediately ran into problems installing native extensions. I wasted time to find this issue, it would be great to have some sort of help or guidance to know what to do. In fact in this case using pixi global install compilers ruby does not work either, so the instructions are specific to conda...