Problems with ruby in fedora 36

Hi. I’m currently running fedora 36 and trying to work on a Jekyll site with ruby, but whatever i do i cant make it work.

I already installed and reinstalled ruby and ruby devel, and installed all the jekyll/ruby dependencies. But if i run bundle install i get a lot of errors.

[yosoyfreeman@yo-soy-freeman-pc yosoyfreeman.github.io-main]$ bundle install
Ignoring commonmarker-0.23.4 because its extensions are not built. Try: gem pristine commonmarker --version 0.23.4
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring http_parser.rb-0.8.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.8.0
Ignoring unf_ext-0.0.8.1 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.8.1
Fetching gem metadata from https://rubygems.org/.........
Using multi_json 1.15.0
Using json 2.6.1
Using concurrent-ruby 1.1.10
Using public_suffix 4.0.7
Following files may not be writable, so sudo is needed:
  /usr/bin
  /usr/share/gems
  /usr/share/gems/build_info
  /usr/share/gems/cache
  /usr/share/gems/doc
  /usr/share/gems/extensions
  /usr/share/gems/gems
  /usr/share/gems/plugins
  /usr/share/gems/specifications
Using racc 1.6.0
Using httpclient 2.8.3
Using coffee-script-source 1.11.1
Using bundler 2.3.12
Using execjs 2.8.1
Using colorator 1.1.0
Fetching commonmarker 0.23.4
Fetching eventmachine 1.2.7
Fetching unf_ext 0.0.8.1
Fetching http_parser.rb 0.8.0


Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle config set --local path 'vendor/bundle'
      bundle install

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password: 
Installing commonmarker 0.23.4 with native extensions
Installing eventmachine 1.2.7 with native extensions
Installing http_parser.rb 0.8.0 with native extensions
Installing unf_ext 0.0.8.1 with native extensions
Fetching ffi 1.15.5
Installing ffi 1.15.5 with native extensions
Using faraday-em_http 1.0.0
Using faraday-em_synchrony 1.0.0
Using faraday-excon 1.1.0
Using faraday-httpclient 1.0.1
Using multipart-post 2.1.1
Using faraday-net_http 1.0.1
Using faraday-net_http_persistent 1.2.0
Using faraday-patron 1.0.0
Using faraday-rack 1.0.0
Using faraday-retry 1.0.3
Using ruby2_keywords 0.0.5
Using filesize 0.2.0
Using forwardable-extended 2.6.0
Using gemoji 3.0.1
Using rb-fsevent 0.11.1
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.3.6
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using jekyll-paginate 1.1.0
Using rubyzip 2.3.2
Using jekyll-swiss 1.0.0
Using unicode-display_width 1.8.0
Using progressbar 1.11.0
Using verbal_expressions 0.1.5
Using nokogiri 1.13.4 (x86_64-linux)
Using algoliasearch 1.27.5
Using addressable 2.8.0
Using coffee-script 2.4.1
Using i18n 0.9.5
Using tzinfo 2.0.4
Using unf 0.1.4
Using faraday-multipart 1.0.3
Using pathutil 0.16.2
Using activesupport 3.2.22.5
Using algolia_html_extractor 2.6.4
Using simpleidn 0.2.1
Using faraday 1.10.0
Using kramdown 2.3.2
Using jekyll-coffeescript 1.1.1
Using terminal-table 1.8.0
Using tzinfo-data 1.2022.1
Using html-pipeline 2.14.1
Using dnsruby 1.61.9
Using sawyer 0.8.2
Using kramdown-parser-gfm 1.1.0
Using octokit 4.22.0
Using jekyll-gist 1.5.0
Using jekyll-commonmark 1.4.0
Using ethon 0.15.0
Using rb-inotify 0.10.1
Using typhoeus 1.4.0
Using listen 3.7.1
Using sass-listen 4.0.0
Using jekyll-watch 2.2.1
Using github-pages-health-check 1.17.9
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using em-websocket 0.5.3
Using jekyll 3.9.2
Using jekyll-commonmark-ghpages 0.2.0
Using jekyll-avatar 0.7.0
Using jekyll-default-layout 0.1.4
Using jekyll-feed 0.15.1
Using jekyll-github-metadata 2.13.0
Using jekyll-readme-index 0.3.0
Using jekyll-mentions 1.6.0
Using jekyll-optional-front-matter 0.3.2
Using jekyll-include-cache 0.2.1
Using jekyll-redirect-from 0.16.0
Using jekyll-relative-links 0.6.1
Using jekyll-remote-theme 0.4.3
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Using jekyll-titles-from-headings 0.5.3
Using jemoji 0.12.0
Using jekyll-algolia 1.7.1
Using jekyll-theme-architect 0.2.0
Using jekyll-theme-hacker 0.2.0
Using jekyll-theme-leap-day 0.2.0
Using jekyll-theme-dinky 0.2.0
Using jekyll-theme-cayman 0.2.0
Using jekyll-theme-merlot 0.2.0
Using jekyll-theme-primer 0.6.0
Using jekyll-theme-slate 0.2.0
Using jekyll-theme-tactile 0.2.0
Using jekyll-theme-midnight 0.2.0
Using jekyll-theme-minimal 0.2.0
Using jekyll-theme-modernist 0.2.0
Using jekyll-theme-time-machine 0.2.0
Using minima 2.5.1
Using github-pages 226
Bundle complete! 9 Gemfile dependencies, 108 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
[yosoyfreeman@yo-soy-freeman-pc yosoyfreeman.github.io-main]$ bundle exec jekyll serve
Ignoring commonmarker-0.23.4 because its extensions are not built. Try: gem pristine commonmarker --version 0.23.4
Ignoring eventmachine-1.2.7 because its extensions are not built. Try: gem pristine eventmachine --version 1.2.7
Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5
Ignoring http_parser.rb-0.8.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.8.0
Ignoring unf_ext-0.0.8.1 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.8.1
Could not find commonmarker-0.23.4, eventmachine-1.2.7, http_parser.rb-0.8.0, ffi-1.15.5, unf_ext-0.0.8.1 in any of the sources
Run `bundle install` to install missing gems.

I tried to do what the log say and run

gem pristine commonmarker --version 0.23.4

or bundle install, but after any of that commands finish nothing changes and i get back to the loop. What is failing?

That tells you the problem. Did you try the install using sudo? Did you try installing into ~/vendor/bundle as your regular user?

HI, Yes, just after that messages it allows me to enter my pass. Tried using sudo since the start and get the same results.

You probably want to use rvm or rbenv. It’s not a good idea to mix rpm and gem ruby libraries and conflicts are likely, especially if you host multiple ruby projects on the same box.

To be honest, I containerize all my ruby projects at this point and keep them totally separate from each other and the host ruby that way.

4 Likes

+1

We shouldn’t install gems using sudo (just as we shouldn’t install python packages via pip with sudo), they’ll overwrite files installed using dnf and that can create all sorts of issues which are really hard to correct.

bundle can install in a provided location. See bundle help install for more information on the --pathoption, for example. It will use the same paths used by gem, which you can see using gem environment.

More information on the web, e.g:

1 Like

Loads of good suggestions here, so perhaps one of them has fixed your issue. If so, please use the Solution button to show which one fixed it.
If none of these worked for you, here’s another potential fix. When I run into this issue, usually due to a new Ruby version, I uninstall all the gems for which I see the complaint about extensions not being built, then reinstall either with bundle or gem.
Just one of those annoying things about doing updates, having to find what needs to be manually upgraded and how to do so. (My favorite annoyance happens to be Postgresql version updates and having to manually pull the databases up.)

2 Likes

When I was an Oracle DBA in corporations, I always had to do that.

2 Likes

Thank you so much for all the help! I will try it as soon as i can and tell you if i can manage to make it work.

1 Like

i tried installed locally, then running bundle exec rake preview to start the server, then it ask me to run bundle install, and the loop start over. And the "

Ignoring commonmarker-0.23.4 because its extensions are not built. Try: gem pristine commonmarker --version 0.23.4

and similar errors keeps appearing, but i cant make it work. I will try with rvm, but right now it seems quite difficult.

I think i should uninstall rubygems, but dnf uninstall rubygems does not find the package. Is named different in fedora?

So i can have a clean installation with RVM.

edit:

trying to install GPD keys for RVM it says

gpg: recepción del servidor de claves fallida: El servidor ha indicado un fallo

which translates like:

GPD keys reception failed: the server has pointed an error.
1 Like

For each of these, try manually removing, such as
gem uninstall commonmarker
When all of the “extensions are not built” gems have been uninstalled, retry bundle install. If any gems fail to build with their extensions at this point, you’ll need to track down why, resolve those build issues, and install again. Some gems may require some other files to be independently installed, usually due to dependencies on some package headers or libraries.

1 Like

I manually uninstalled everything as you set, and installed using RVM. i am getting the same errors. I cant find any way to make it work.

Hopefully you aren’t getting further into a mess by trying multiple things at the same time, such as uninstalling using default ruby then installing using rvm then using bundle without the rvm environment, etc. Stick to one exploration path at a time.
Try gem uninstall commonmarker then gem list commonmarker (to ensure you don’t have multiple versions around), then gem install commonmarker --version 0.23.4. Copy the output and paste it here using the </> markup so we can see the failure, if any. If no failure with the gem install, then copy/paste the output of bundle install.

Thank you so much and sorry for the errors. I’m totally new to fedora and ruby.

I did what you said and I’m no longer getting errors, when i do “bundle install” everything seems fine, but is like nothing is being installed.


Using concurrent-ruby 1.1.10
Following files may not be writable, so sudo is needed:
  /usr/bin
  /usr/share/gems
  /usr/share/gems/build_info
  /usr/share/gems/cache
  /usr/share/gems/doc
  /usr/share/gems/extensions
  /usr/share/gems/gems
  /usr/share/gems/plugins
  /usr/share/gems/specifications
Using i18n 0.9.5
Using multi_json 1.15.0
Using activesupport 3.2.22.5
Using public_suffix 4.0.7
Using addressable 2.8.0
Using json 2.6.1
Using racc 1.6.0
Using nokogiri 1.13.4 (x86_64-linux)
Using algolia_html_extractor 2.6.4
Using httpclient 2.8.3
Using algoliasearch 1.27.5
Using bundler 2.3.12
Using coffee-script-source 1.11.1
Using execjs 2.8.1
Using coffee-script 2.4.1
Using colorator 1.1.0
Using commonmarker 0.23.4
Using unf_ext 0.0.8.1
Using unf 0.1.4
Using simpleidn 0.2.1
Using dnsruby 1.61.9
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using em-websocket 0.5.3
Using ffi 1.15.5
Using ethon 0.15.0
Using faraday-em_http 1.0.0
Using faraday-em_synchrony 1.0.0
Using faraday-excon 1.1.0
Using faraday-httpclient 1.0.1
Using multipart-post 2.1.1
Using faraday-multipart 1.0.3
Using faraday-net_http 1.0.1
Using faraday-net_http_persistent 1.2.0
Using faraday-patron 1.0.0
Using faraday-rack 1.0.0
Using faraday-retry 1.0.3
Using ruby2_keywords 0.0.5
Using faraday 1.10.0
Using filesize 0.2.0
Using forwardable-extended 2.6.0
Using gemoji 3.0.1
Using sawyer 0.8.2
Using octokit 4.22.0
Using typhoeus 1.4.0
Using github-pages-health-check 1.17.9
Using rb-fsevent 0.11.1
Using rb-inotify 0.10.1
Using sass-listen 4.0.0
Using sass 3.7.4
Using jekyll-sass-converter 1.5.2
Using listen 3.7.1
Using jekyll-watch 2.2.1
Using rexml 3.2.5
Using kramdown 2.3.2
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using jekyll 3.9.2
Using jekyll-avatar 0.7.0
Using jekyll-coffeescript 1.1.1
Using jekyll-commonmark 1.4.0
Using jekyll-commonmark-ghpages 0.2.0
Using jekyll-default-layout 0.1.4
Using jekyll-feed 0.15.1
Using jekyll-gist 1.5.0
Using jekyll-github-metadata 2.13.0
Using jekyll-include-cache 0.2.1
Using html-pipeline 2.14.1
Using jekyll-mentions 1.6.0
Using jekyll-optional-front-matter 0.3.2
Using jekyll-paginate 1.1.0
Using jekyll-readme-index 0.3.0
Using jekyll-redirect-from 0.16.0
Using jekyll-relative-links 0.6.1
Using rubyzip 2.3.2
Using jekyll-remote-theme 0.4.3
Using jekyll-seo-tag 2.8.0
Using jekyll-sitemap 1.4.0
Using jekyll-swiss 1.0.0
Using jekyll-theme-architect 0.2.0
Using jekyll-theme-cayman 0.2.0
Using jekyll-theme-dinky 0.2.0
Using jekyll-theme-hacker 0.2.0
Using jekyll-theme-leap-day 0.2.0
Using jekyll-theme-merlot 0.2.0
Using jekyll-theme-midnight 0.2.0
Using jekyll-theme-minimal 0.2.0
Using jekyll-theme-modernist 0.2.0
Using jekyll-theme-primer 0.6.0
Using jekyll-theme-slate 0.2.0
Using jekyll-theme-tactile 0.2.0
Using jekyll-theme-time-machine 0.2.0
Using jekyll-titles-from-headings 0.5.3
Using jemoji 0.12.0
Using kramdown-parser-gfm 1.1.0
Using minima 2.5.1
Using unicode-display_width 1.8.0
Using terminal-table 1.8.0
Using github-pages 226
Using progressbar 1.11.0
Using verbal_expressions 0.1.5
Using jekyll-algolia 1.7.1
Using tzinfo 2.0.4
Using tzinfo-data 1.2022.1
Bundle complete! 9 Gemfile dependencies, 108 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

If I try to start the Jekyll server with bundle exec rake preview, it says it cant find the gems.

bundler: command not found: rake
Install missing gem executables with `bundle install`

and we are back in the loop.

Did you read that last line? It specifically tells you that sudo is needed to be able to write those changes.

Let’s go back a few posts … Ankur mentions early on how to do gem installations without needing sudo … Using sudo, you’d be managing gem installations for all users of the server/workstation, but a safer option is to just manage gems for your individual user. In particular, since you’re using bundle for everything, check out bundle help install as he recommends.
By the way, this is more of a question about how to use Ruby in a Linux environment rather than a specific Fedora question.

1 Like

100% this is true. It’s best to use rbenv or rvm and install gems in that environment without using sudo. Use gem, bundle, or rake, etc., in that context.

1 Like

Did you update F36, ruby has some updates.