developer-portal / content

Content for the Fedora Developer Portal
https://developer.fedoraproject.org/
GNU General Public License v2.0
106 stars 250 forks source link

: ruby ror-installation.md #401

Closed hendridg closed 2 years ago

hendridg commented 2 years ago

I make all steps, and the end when I put

bundle --local

return this error Could not find gem 'puma (~> 5.0)' in rubygems repository https://rubygems.org/ or installed locally. The source contains the following versions of 'puma': 4.3.6

I check my version of puma and:

[hendrid@fedora app3]$ puma --version puma version 5.5.2

I don't understand what happened.

To make an app I have to do this:

[hendrid@fedora app2]$ bundle config set --local path 'vendor/bundle' [hendrid@fedora app2]$ bundle install

and then this

[hendrid@fedora app2]$ rails webpacker:install

pvalena commented 2 years ago

Bundler by default does not use your locally installed dependencies, but rather "bundles" them in a separate directory. --local prevents that (no downloading from internet).

There may be an issue in Fedora let me reproduce that! (I'm a Fedora RoR maintainer).

pvalena commented 2 years ago

I've investigated, and found out that the issue is. It is caused by restriction in the Gemfile.

$ grep puma Gemfile
gem 'puma', '~> 5.0'

When on system:

$ gem list | grep puma
puma (4.3.6)

We do not modify the default app, or the dependencies. This needs to be adjusted per-app basis. Please note that this is not the only dependency that's diverged from upstream[*].

Unfortunately, in Fedora, there's still older Puma (but I'm working on puma update for Fedora as well).


[*] We can package only one package version per system, so the upgrades need to be made progressively, not to break other packages, while executing test suites for all packaged gems (that's why it's hard to update Fedora packages).

pvalena commented 2 years ago

To conclude, it's quite easy to bundle --local the app, with few modifications to the gemfile (mostly commenting out useless dependencies): https://gist.github.com/dac638543855de02ee3b59fec192e4bb

pvalena commented 2 years ago

@jackorp Feel free to modify the RoR page if you think there's missing something, based on this Issue. I can't see what's there to enhance, as we don't want to document per-rails version dependencies.