Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'gem install pdd' failed on MacOs Silicone Chip #227

Closed
pnatashap opened this issue Jan 9, 2024 · 7 comments
Closed

'gem install pdd' failed on MacOs Silicone Chip #227

pnatashap opened this issue Jan 9, 2024 · 7 comments

Comments

@pnatashap
Copy link
Contributor

  1. First of all some libraries requires higher permissions (run with sudo):
    ~ % gem install pdd Fetching pdd-0.23.2.gem Fetching slop-4.10.1.gem Fetching ruby-filemagic-0.7.3.gem Fetching rainbow-3.1.1.gem ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

  2. But fails even if them:
    `sudo gem install pdd
    Password:
    Fetching pdd-0.23.2.gem
    Fetching ruby-filemagic-0.7.3.gem
    Fetching rainbow-3.1.1.gem
    Fetching slop-4.10.1.gem
    Successfully installed slop-4.10.1
    Building native extensions. This could take a while...
    ERROR: Error installing pdd:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ruby-filemagic-0.7.3/ext/filemagic
    /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20240107-49962-hl5jhx.rb extconf.rb
    checking for -lgnurx... no
    checking for magic_open() in -lmagic... no
    *** ERROR: missing required library to compile this module
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers. Check the mkmf.log file for more details. You may
    need configuration options.`

@php-coder
Copy link
Contributor

  1. this is how the things works on *nix systems -- in order to install files you have to have write permissions to the destination directory. One way to solve it, is to use sudo (su, etc). Another way, is to change the destination directory to the one where you have permissions (for instance, home directory). There is --user-install option exactly for that purpose.

  2. while it looks like related to pdd, in fact it isn't. It caused by a missing dependency for one of the pdd's dependencies. ruby-filemagic seems like a native extension that requires libmagic library and its headers the compilation. You have to install it with command brew install libmagic (or apt install libmagic-dev on Ubuntu).

As I can see, the only thing that can be improved is the installation documentation.

@yegor256
Copy link
Member

@pnatashap if the solution explained by @php-coder works for you, maybe you can update the README file accordingly, in order to help other users?

@pnatashap
Copy link
Contributor Author

Yes, I fix this also using this way, will add a note to README about this. Problem on Windows is also in this library, will check if it possible to fix without WSL

@pnatashap
Copy link
Contributor Author

Looks like there is no easy way to use libmagic on windows, so it's better to update docs for now and create a docker file to simplify usage

pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 16, 2024
@php-coder
Copy link
Contributor

and create a docker file to simplify usage

In case it's useful for someone, here is mine:

FROM ruby:2.7-slim
RUN apt-get update && apt -y install gcc libmagic-dev make
RUN gem install pdd

pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
[cqfn#227] Add a space to display the link
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
pnatashap added a commit to pnatashap/pdd that referenced this issue Jan 17, 2024
[cqfn#227] Fix for Ruby version and os names
@php-coder
Copy link
Contributor

This was fixed by #230 and seems like we can close it.

@pnatashap
Copy link
Contributor Author

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants