Question: How to install gems and require them without restarting script #4955
Replies: 1 comment
-
When you install gem by irb(main):004:0> require 'a'
<internal:/home/retro/.rubies/ruby-3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- a (LoadError)
from <internal:/home/retro/.rubies/ruby-3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from (irb):4:in `<main>'
from /home/retro/.rubies/ruby-3.0.2/lib/ruby/gems/3.0.0/gems/irb-1.3.5/exe/irb:11:in `<top (required)>'
from /home/retro/.rubies/ruby-3.0.2/bin/irb:23:in `load'
from /home/retro/.rubies/ruby-3.0.2/bin/irb:23:in `<main>'
irb(main):005:0> Gem.install('a')
Fetching a-0.2.8.gem
=>
[Gem::Specification.new do |s|
s.name = "a"
s.version = Gem::Version.new("0.2.8")
s.installed_by_version = Gem::Version.new("3.2.22")
s.authors = ["author"]
s.date = Time.utc(2018, 10, 17)
s.email = "[email protected]"
s.executables = ["a"]
s.files = ["README.md", "a.gemspec", "bin/a", "lib/a.rb", "lib/commands/gem.rb", "rakefile.rb"]
s.homepage = "https://github.com/axgle/a"
s.licenses = ["MIT"]
s.require_paths = ["lib", "lib"]
s.required_ruby_version = Gem::Requirement.new([">= 2.0.0"])
s.rubygems_version = "2.5.2.3"
s.specification_version = 4
s.summary = "a gem generator etc."
end]
irb(main):006:0> require 'a'
=> true |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to install a gem with a system call, then require that gem without exiting and restarting a script?
If so, how could I do that?
Beta Was this translation helpful? Give feedback.
All reactions