rdp / specific_install

rubygems plugin to allow you to install an "edge" gem straight from its github repository
MIT License
288 stars 30 forks source link

Fails to install gem if it has prerelease gems in its dependencies. #43

Open shkrt opened 6 years ago

shkrt commented 6 years ago

For example:

$ gem specific_install 'rails/rails'

or

$ gem specific_install 'https://github.com/rails/rails.git'

or

$ gem specific_install -l 'https://github.com/rails/rails.git'

results in:

$ ERROR:  While executing gem ... (Gem::UnsatisfiableDependencyError)
    Unable to resolve dependency: 'rails (= 5.2.0.alpha)' requires 'railties (= 5.2.0.alpha)'

and if we start to install dependencies one-by-one, we also got stuck:

$ gem specific_install 'https://github.com/rails/rails.git' -d activesupport`  # -Success
$ gem list activesupport 
$ activesupport (5.2.0.alpha, 5.1.4)
$ gem specific_install 'https://github.com/rails/rails.git' -d actionview
$ ERROR:  While executing gem ... (Gem::DependencyError)
    Unresolved dependency found during sorting - activesupport (>= 4.2.0) (requested by rails-dom-testing-2.0.3)

This is caused by the presence of prerelease gems in gem's dependencies. If we initialize Gem::DependencyInstaller with prerelease:true, then at least gem specific_install 'rails/rails' -d actionview seems to work fine. So, I think it would be convenient to add some command line flag, that will set prerelease option to true, if provided.

rdp commented 6 years ago

Can you think of an easy way to fix this command line wise?

shkrt commented 6 years ago

Will think of solving it, but I've yet to figure out the case with nested prerelease dependencies, because with Gem::DependencyInstaller.new(prerelease: true).install dep_name we can install 'rails/rails' repository step-by-step:

$ gem specific_install 'https://github.com/rails/rails.git' -d actionview

but the following

$ gem specific_install 'rails/rails'

keeps failing

rdp commented 6 years ago

I'm not sure if rubygems has a way to do dependencies while building a local gem unfortunately...

On Tue, Oct 17, 2017 at 2:51 AM, Ruslan Gafurov notifications@github.com wrote:

Will think of solving it, but I've yet to figure out the case with nested prerelease dependencies, because with Gem::DependencyInstaller.new(prerelease: true).install dep_name we can install 'rails/rails' repository step-by-step:

$ gem specific_install 'https://github.com/rails/rails.git' -d actionview

but the following

$ gem specific_install 'rails/rails'

keeps failing

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rdp/specific_install/issues/43#issuecomment-337163370, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAw0NQoqSM_Mix5CNpnxCcR1GQL8OYCks5stGp6gaJpZM4P5pwV .

rdp commented 1 year ago

OK attempted to merge it, give it a try sometime :)

On Sat, Feb 4, 2023 at 4:29 AM basicfeatures @.***> wrote:

Any news on this?

Trying to gem specific_install --user-install https://github.com/rails/rails for version 7.1.0-alpha but:

% gem specific_install --user-install https://github.com/rails/rails.git -d actionpack railties actionview actioncable actionmailbox actionmailer actiontext activejob activemodel activerecord activestorage activesupport git version 2.37.3 git installing from https://github.com/rails/rails.git Cloning into '/tmp/d20230204-27124-t48i9k'... remote: Enumerating objects: 820996, done. remote: Counting objects: 100% (94/94), done. remote: Compressing objects: 100% (81/81), done. remote: Total 820996 (delta 36), reused 22 (delta 10), pack-reused 820902 Receiving objects: 100% (820996/820996), 246.70 MiB | 10.68 MiB/s, done. Resolving deltas: 100% (611618/611618), done. Updating files: 100% (4516/4516), done. Updated 0 paths from the index fatal: Cannot do hard reset with paths. ERROR: While executing gem ... (RuntimeError) '$ git reset --hard actionview' exited with an error /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:75:in git' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:249:inreset_to_commit' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:157:in block in install_from_git' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:155:inchdir' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:155:in install_from_git' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:135:ininstall_git' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:90:in determine_source_and_install' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:67:inblock in execute' /usr/local/lib/ruby/3.1/tmpdir.rb:96:in mktmpdir' /home/dev/.local/share/gem/ruby/3.1/gems/specific_install-0.3.8/lib/rubygems/commands/specific_install_command.rb:59:inexecute' /usr/local/lib/ruby/3.1/rubygems/command.rb:323:in invoke_with_build_args' /usr/local/lib/ruby/3.1/rubygems/command_manager.rb:185:inprocess_args' /usr/local/lib/ruby/3.1/rubygems/command_manager.rb:149:in run' /usr/local/lib/ruby/3.1/rubygems/gem_runner.rb:51:inrun' /usr/local/bin/gem:21:in `

'

— Reply to this email directly, view it on GitHub https://github.com/rdp/specific_install/issues/43#issuecomment-1416727846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADBUFGLTJTZXD6UXDLVVTWVY4RBANCNFSM4D7GTQKQ . You are receiving this because you commented.Message ID: @.***>