Ruby

Allikas: Imre kasutab arvutit
Mine navigeerimisribaleMine otsikasti

Sissejuhatus

Tööpõhimõte

Väited

  • Ruby on virtuaalne arvuti - st ruby runtime tegeleb bytecode, mäluhalduse, scheduling jms ülesannetega - selles runtime'is käititatakse ruby keeles programmeeritud tegevused
  • TODO

Populaarsed ruby failinimede lõpud

  • .rb - ruby source code jms
  • .rake - ruby maitseline Makefile
  • .gemspec - paketihaldusega seotud fail
  • .rdoc ja .ri - dokumentatsioon

Käesolev tekst tegeleb muu hulgas kahe teemaga

  • ruby enda keskkonna paigaldamine - seejuures viisil, et kasutamisel saab valida erinevate ruby versioonide vahel
  • ruby keskkonda tarkvara paigaldamine gem kujul - seejuures saab paigaldada sama tarkvara erinevaid versioone

Ruby paigaldamine tavakasutaja osakonda

Käesoleval juhul paigaldatakse Ruby lahendus tavakasutajana, alustatatakse süsteemi ettevalmistamisest

root@ubuntu-2604-01:~# apt-get install build-essential autoconf libssl-dev libyaml-dev zlib1g-dev libffi-dev libgmp-dev rustc

kus

  • c kompilaator on vajalik c xxx

Otsustatakse hallata erinevaid ruby keskkondi rbenv lahenduse abil

ruby@ubuntu-2604-01:~$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash

ruby@ubuntu-2604-01:~$ rbenv install -l

ruby@ubuntu-2604-01:~$ rbenv install 3.3.0
==> Downloading ruby-3.3.0.tar.gz...
-> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
  % Total    % Received % Xferd  Average Speed  Time    Time    Time   Current
                                 Dload  Upload  Total   Spent   Left   Speed
100 21.04M 100 21.04M   0      0 11.16M      0   00:01   00:01         11.16M
==> Installing ruby-3.3.0...
-> ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" --enable-shared --with-ext=openssl,psych,+
-> make -j 4
-> make install
==> Installed ruby-3.3.0 to /home/ruby/.rbenv/versions/3.3.0

NOTE: to activate this Ruby version as the new default, run: rbenv global 3.3.0

ruby@ubuntu-2604-01:~$ rbenv global 3.3.0
ruby@ubuntu-2604-01:~$ find . -mmin -1 -ls
   393269      4 drwxrwxr-x  15 ruby     ruby         4096 Jun  6 15:28 ./.rbenv
   413953      4 -rw-rw-r--   1 ruby     ruby            6 Jun  6 15:28 ./.rbenv/version
ruby@ubuntu-2604-01:~$ cat ./.rbenv/version
3.3.0

ruby@ubuntu-2604-01:~$ ruby -v
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]

ruby@ubuntu-2604-01:~$ which ruby
/home/ruby/.rbenv/shims/ruby

ruby@ubuntu-2604-01:~$ which gem
/home/ruby/.rbenv/shims/gem

ruby@ubuntu-2604-01:~$ tail -n 2 .bashrc
# Added by `rbenv init` on Sat Jun  6 02:42:37 PM UTC 2026
eval "$(~/.rbenv/bin/rbenv init - --no-rehash bash)"

Paigaldatud ruby versioonid

ruby@ubuntu-2604-01:~$ ls -ld .rbenv/versions/*
drwxr-xr-x 6 ruby ruby 4096 Jun  6 14:52 .rbenv/versions/3.3.0
drwxr-xr-x 6 ruby ruby 4096 Jun  6 15:45 .rbenv/versions/3.4.9
drwxr-xr-x 6 ruby ruby 4096 Jun  6 15:42 .rbenv/versions/4.0.5
drwxrwxr-x 6 ruby ruby 4096 Jun  6 15:48 .rbenv/versions/truffleruby-34.0.1

Gem

gem on ruby spetsiifiliselt pakendatud tarkvara, nt kopeerides https://rubygems.org/ aadressilt konkreetse .gem faili, saab tema kohta küsida

ruby@ubuntu-2604-01:~$ gem specification ./c7decrypt-0.3.3.gem files
---
- ".gitignore"
- ".rspec"
- ".travis.yml"
- CONTRIBUTING.md
- Gemfile
- LICENSE
- README.md
- Rakefile
- bin/c7decrypt
- c7decrypt.gemspec
- lib/c7decrypt.rb
- lib/c7decrypt/type5/constants.rb
- lib/c7decrypt/type5/type5.rb
- lib/c7decrypt/type7/constants.rb
- lib/c7decrypt/type7/exceptions.rb
- lib/c7decrypt/type7/type7.rb
- lib/c7decrypt/version.rb

ruby@ubuntu-2604-01:~$ gem specification ./c7decrypt-0.3.3.gem summary
--- Ruby based Cisco Password Encryptor/Decryptor

Tehniliselt on ta tar arhiiv

ruby@ubuntu-2604-01:~$ tar tf ./c7decrypt-0.3.3.gem
metadata.gz
data.tar.gz
checksums.yaml.gz

Gem haldus

ruby@ubuntu-2604-01:~/20260605-3$ gem source
*** NO CONFIGURED SOURCES, DEFAULT SOURCES LISTED BELOW ***

https://rubygems.org/

viimase oxidized versiooni esitamine

ruby@ubuntu-2604-01:~$ gem search -r ^oxidized$

*** REMOTE GEMS ***

oxidized (0.37.0)

kõigi oxidized versioonide esitamine

ruby@ubuntu-2604-01:~$ gem search -r -a ^oxidized$

*** REMOTE GEMS ***

oxidized (0.37.0, 0.36.0, 0.35.0, 0.34.3, 0.34.2, 0.34.1, 0.34.0, 0.33.0, ...)

gem kirjeldus

ruby@ubuntu-2604-01:~$ gem specification net-http summary
--- HTTP client api for Ruby.

gem sisu

ruby@ubuntu-2604-01:~$ gem contents oxidized

Sõltuvused

ruby@ubuntu-2604-01:~$ gem dependency oxidized -r

Parem

ruby@ubuntu-2604-01:~/20260605-3$ cat Gemfile
source 'https://rubygems.org'
gem 'oxidized'

ruby@ubuntu-2604-01:~/20260605-3$ bundle check
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
The following gems are missing
 * oxidized (0.37.0)
 * bcrypt_pbkdf (1.1.2)
 * ed25519 (1.4.0)
 * net-http-digest_auth (1.4.1)
 * net-ssh (7.3.2)
 * net-telnet (0.2.0)
 * psych (5.4.0)
 * rugged (1.9.0)
 * semantic_logger (4.18.0)
 * slop (4.10.1)
 * syslog (0.4.0)
 * syslog_protocol (0.9.2)
 * concurrent-ruby (1.3.6)
 * timeout (0.6.1)
Install missing gems with `bundle install`

Paigaldatud gem nimekiri

ruby@ubuntu-2604-01:~$ ls -ld .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/* | head -n 5
drwxr-xr-x  4 ruby ruby 4096 Jun  6 15:42 .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/abbrev-0.1.2
drwxr-xr-x  3 ruby ruby 4096 Jun  6 17:06 .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/addressable-2.9.0
drwxrwxr-x  4 ruby ruby 4096 Jun  6 16:18 .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/asetus-0.4.0
drwxr-xr-x  4 ruby ruby 4096 Jun  6 15:42 .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/base64-0.3.0
drwxr-xr-x  4 ruby ruby 4096 Jun  6 15:42 .rbenv/versions/4.0.5/lib/ruby/gems/4.0.0/gems/benchmark-0.5.0
...

Tundub, et tarkvara eemaldamine ei ole alati väga lihtne ega selge

# gem uninstall asetus -v 0.4.0

ja

ruby@ubuntu-2604-01:~$ bundle config set clean true
ruby@ubuntu-2604-01:~$ gem uninstall octokit faraday faraday-net_http sawyer public_suffix addressable json net-http uri
...

Gem rakendus

Paigaldamine algab Gemfile ettavalmistamisest

ruby@ubuntu-2604-01:~/20260605-2$ cat Gemfile
source 'https://rubygems.org'
gem 'sinatra'

paigaldamine

ruby@ubuntu-2604-01:~/20260605-2$ bundle check
ruby@ubuntu-2604-01:~/20260605-2$ bundle install

Paistab, et puuduvad rackup ja puma

ruby@ubuntu-2604-01:~/20260605-2$ bundle add rackup puma
Fetching gem metadata from https://rubygems.org/....
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/....
Fetching nio4r 2.7.5
Fetching puma 8.0.2
Fetching rackup 2.3.1
Installing rackup 2.3.1
Installing nio4r 2.7.5 with native extensions
Installing puma 8.0.2 with native extensions

kusjuures tulemusena on Gemfile sisus kaks rida juures

ruby@ubuntu-2604-01:~/20260605-2$ cat Gemfile
source 'https://rubygems.org'
gem 'sinatra'
gem "rackup", "~> 2.3"
gem "puma", "~> 8.0"

serveri ettevalmistamine

ruby@ubuntu-2604-01:~/20260605-2$ cat server.rb
# server.rb
require 'sinatra'

# Tell Sinatra to accept connections from outside your local host loop
set :bind, '0.0.0.0'
set :port, 4567

# Define the visual landing pad for your web browser
get '/' do
  "<h1>Hello World from Ruby!</h1>
   <p>Your isolated rbenv environment is running a live web server seamlessly!</p>"
end

Käivitamine

ruby@ubuntu-2604-01:~/20260605-2$ bundle exec ruby server.rb
== Sinatra (v4.2.1) has taken the stage on 4567 for development with backup from Puma
Puma starting in single mode...
* Puma version: 8.0.2 ("Into the Arena")
* Ruby version: ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [x86_64-linux]
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 54882
* Listening on http://0.0.0.0:4567
Use Ctrl-C to stop
192.168.10.156 - - [06/Jun/2026:17:18:57 +0000] "GET / HTTP/1.1" 200 114 0.0016
192.168.10.156 - - [06/Jun/2026:17:18:58 +0000] "GET /favicon.ico HTTP/1.1" 404 441 0.0009
192.168.10.156 - - [06/Jun/2026:17:18:58 +0000] "GET / HTTP/1.1" 200 114 0.0006
192.168.10.156 - - [06/Jun/2026:17:18:59 +0000] "GET / HTTP/1.1" 200 114 0.0005
192.168.10.156 - - [06/Jun/2026:17:18:59 +0000] "GET / HTTP/1.1" 200 114 0.0007
192.168.10.156 - - [06/Jun/2026:17:18:59 +0000] "GET / HTTP/1.1" 200 114 0.0008
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2026-06-06 18:13:59 +0000 ===
- Goodbye!
== Sinatra has ended his set (crowd applauds)
ruby@ubuntu-2604-01:~/20260605-2$

Lokaalne Gem puhverserver

Tundub, et muu hulgas lokaalseks gem puhverdamiseks sobib kasutada kahte lahendust

  • gemirro - oskab moodustada staatilist sisu
  • gemstash - oskab nö on-demand puhverdamist

gemirro

Gemfile

ruby@ubuntu-2604-01:~/gemirro-server$ joe Gemfile
source 'https://rubygems.org'

gem 'gemirro'

ning

ruby@ubuntu-2604-01:~/gemirro-server$ bundle check
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
The following gems are missing
 * gemirro (2.0.0)
 * builder (3.3.0)
 * compact_index (0.15.0)
 * confstruct (1.1.0)
 * erubis (2.7.0)
 * httpclient (2.9.0)
 * parallel (1.28.0)
 * rubygems-generate_index (1.2.0)
 * sinatra (3.2.0)
 * slop (3.6.0)
 * thin (1.8.2)
 * hashie (4.1.0)
 * rack (2.2.23)
 * rack-protection (3.2.0)
 * daemons (1.4.1)
 * eventmachine (1.2.7)

Install missing gems with `bundle install`

ruby@ubuntu-2604-01:~/gemirro-server$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Fetching stringio 3.2.0
Installing confstruct 1.1.0
Installing compact_index 0.15.0
Installing builder 3.3.0
Installing parallel 1.28.0
Installing daemons 1.4.1
Installing eventmachine 1.2.7 with native extensions
Installing hashie 4.1.0
Installing stringio 3.2.0 with native extensions
Installing rubygems-generate_index 1.2.0
Installing rack-protection 3.2.0
Installing slop 3.6.0
Installing gemirro 2.0.0
Installing sinatra 3.2.0
Installing rack 2.2.23
Installing erubis 2.7.0
Installing httpclient 2.9.0
Installing thin 1.8.2 with native extensions
Bundle complete! 1 Gemfile dependency, 25 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
ruby@ubuntu-2604-01:~/gemirro-server$

gemstash

TODO

Gem turvalisus

Väited

  • iseensest gem formaat ja käsitlus jne võimaldab signeeritud viisil toimetamist
  • gem signeeritumist praktiliselt ei kasutata - nt https://rubygems.org/ ei ole gemid signeeritud
  • gem puhul on siiski kasutusel räsid
  • st gem pidamine ei ole kaitstud sellise turvalisusega nagu nt apt repode kasutamine
  • gem signeerimine sarnaneb rpm lähenemisele mõttes, et signeeritakse üksikut pakette mitte pakettide komplekti (nagu apt puhul)

Kasulikud lisamaterjalid

Signeeritud gem moodustamine

Signeerimiseks vajaliku krüptomaterjali moodustamine

ruby@ubuntu-2604-01:~/secure-gem$ gem cert --build ruby@ubuntu-2604-01.local
Passphrase for your Private Key:
Please repeat the passphrase for your Private Key:

Certificate: /home/ruby/secure-gem/gem-public_cert.pem
Private Key: /home/ruby/secure-gem/gem-private_key.pem
Don't forget to move the key file to somewhere private!
ruby@ubuntu-2604-01:~/secure-gem$

Sertifikaadi lisamine

ruby@ubuntu-2604-01:~/secure-gem$ gem cert --add gem-public_cert.pem
Added '/CN=ruby/DC=ubuntu-2604-01/DC=local'

ruby@ubuntu-2604-01:~/secure-gem$ gem cert --list
/CN=ruby-02/DC=ubuntu-2604-01/DC=local

Failisüsteemis paigutatakse lisatud sertifikaat kasutaja kodukataloogi alamkataloogi '.gem/trust'

ruby@ubuntu-2604-01:~/secure-gem$ find /home/ruby/ -mmin -2 -type f -ls
   536648      4 -rw-------   1 ruby     ruby         1655 Jun  7 10:25 /home/ruby/.gem/trust/cert-d0fac3b0f52e44451f5b69ef8927c9d7d77540b19fb379afa214f9580cfd280e.pem

Sertifikaadi eemaldamine

ruby@ubuntu-2604-01:~/secure-gem$ gem cert --remove ruby
Removed '/CN=ruby-02/DC=ubuntu-2604-01/DC=local'

Signeeritud gem moodustamine

ruby@ubuntu-2604-01:~$ mkdir -p ~/secure-gem
ruby@ubuntu-2604-01:~$ cd ~/secure-gem

ruby@ubuntu-2604-01:~/secure-gem$ cat secure_test.gemspec
Gem::Specification.new do |s|
  s.name        = 'secure_test'
  s.version     = '1.0.0'
  s.summary     = "Cryptographically Signed Test Asset"
  s.authors     = ["Ruby Lab Admin"]
  s.files       = []
  
  # Inject the cryptographic signing rails
  s.signing_key = File.expand_path('~/gem-private_key.pem')
  s.cert_chain  = [File.expand_path('~/gem-public_cert.pem')]
end

ruby@ubuntu-2604-01:~/secure-gem$ gem build secure_test.gemspec

ruby@ubuntu-2604-01:~/secure-gem$ cp secure_test-1.0.0.gem /home/ruby/gemstash-proxy/data/gem_cache/

ruby@ubuntu-2604-01:~/secure-gem$ cd ~/20260605-5

ruby@ubuntu-2604-01:~/20260605-5$ gem install secure_test-1.0.0.gem -P HighSecurity
ruby@ubuntu-2604-01:~/20260605-5$ gem uninstall secure_test --all --executables

gem kui tar arhiivi sisu paistab, lisaks tavalistele kolmele failile on lisaks vastavad .sig failid

ruby@ubuntu-2604-01:~/secure-gem$ tar tf secure_test-1.0.0.gem
metadata.gz
metadata.gz.sig
data.tar.gz
data.tar.gz.sig
checksums.yaml.gz
checksums.yaml.gz.sig

Misc

dwalin@oxidized-2004:~$ sudo gem install oxidized-script oxidized-web --explain --verbose > sudo-gem-install-oxidized-script-oxidized-web--explain-verbose.txt 2>&
HEAD https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=oxidized-script
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=oxidized,slop
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=asetus,bcrypt_pbkdf,ed25519,net-ssh,net-telnet,rugged
200 OK
Gems to install:
  slop-3.6.0
  rugged-0.99.0
  net-telnet-0.1.1
  net-ssh-5.2.0
  asetus-0.3.0
  oxidized-0.26.3
  oxidized-script-0.6.0
HEAD https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=oxidized-web
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=charlock_holmes,emk-sinatra-url-for,haml,htmlentities,json,oxidized,puma,rack-test,sass,sin
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=temple,tilt
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=rack,rack-protection
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=asetus,bcrypt_pbkdf,ed25519,net-ssh,net-telnet,rugged,slop
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=sass-listen
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=backports,multi_json
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=rb-fsevent,rb-inotify
200 OK
GET https://auul.pri.ee/repository/rubygems-group-public/api/v1/dependencies?gems=ffi
200 OK
Gems to install:
  rack-1.6.13
  rack-test-0.7.0
  json-2.3.0
  multi_json-1.15.0
  rack-protection-1.5.5
  tilt-2.0.10
  backports-3.23.0
  sinatra-1.4.8
  sinatra-contrib-1.4.7
  ffi-1.15.5
  rb-inotify-0.10.1
  rb-fsevent-0.11.0
  sass-listen-4.0.0
  sass-3.7.4
  puma-3.11.4
  asetus-0.3.0
  bcrypt_pbkdf-1.1.0
  ed25519-1.2.4
  net-ssh-5.2.0
  net-telnet-0.2.0
  rugged-0.28.5
  slop-4.9.1
  oxidized-0.28.0
  htmlentities-4.3.4
  temple-0.8.2
  haml-5.2.2
  emk-sinatra-url-for-0.2.1
  charlock_holmes-0.7.7
  oxidized-web-0.13.1
dwalin@oxidized-2004:~$ sudo gem install oxidized-script oxidized-web --explain
Gems to install:
  slop-4.10.1
  syslog_protocol-0.9.2
  logger-1.4.2
  syslog-0.4.0
  concurrent-ruby-1.3.6
  semantic_logger-4.18.0
  rugged-1.9.0
  date-3.0.0
  stringio-0.1.0
  psych-5.4.0
  net-telnet-0.2.0
  net-ssh-7.3.2
  net-http-digest_auth-1.4.1
  time-0.4.2
  timeout-0.1.0
  net-protocol-0.2.2
  net-ftp-0.3.9
  ed25519-1.4.0
  bcrypt_pbkdf-1.1.2
  asetus-0.4.0
  oxidized-0.37.0
  oxidized-script-0.7.0
Gems to install:
  tilt-2.7.0
  rack-3.2.6
  base64-0.3.0
  rack-session-2.1.2
  logger-1.7.0
  rack-protection-4.2.1
  mustermann-3.1.1
  sinatra-4.2.1
  multi_json-1.21.1
  sinatra-contrib-4.2.1
  nio4r-2.7.5
  puma-7.2.1
  syslog_protocol-0.9.2
  syslog-0.4.0
  slop-4.10.1
  concurrent-ruby-1.3.6
  semantic_logger-4.18.0
  rugged-1.9.0
  date-3.0.0
  stringio-0.1.0
  psych-5.4.0
  net-telnet-0.2.0
  net-ssh-7.3.2
  net-http-digest_auth-1.4.1
  time-0.4.2
  timeout-0.1.0
  net-protocol-0.2.2
  net-ftp-0.3.9
  ed25519-1.4.0
  bcrypt_pbkdf-1.1.2
  asetus-0.4.0
  oxidized-0.37.0
  json-2.3.0
  htmlentities-4.4.2
  thor-1.5.0
  temple-0.10.4
  haml-6.4.0
  emk-sinatra-url-for-0.2.1
  charlock_holmes-0.7.9
  oxidized-web-0.18.1
dwalin@oxidized-2004:~$ sudo gem sources
*** CURRENT SOURCES ***

https://auul.pri.ee/repository/rubygems-group-public/

dwalin@oxidized-2004:~$ sudo gem sources -c
*** Removed specs cache ***
dwalin@oxidized-2004:~$ sudo gem install oxidized-script oxidized-web --explain
Gems to install:
  slop-3.6.0
  rugged-0.99.0
  net-telnet-0.1.1
  net-ssh-5.2.0
  asetus-0.3.0
  oxidized-0.26.3
  oxidized-script-0.6.0
Gems to install:
  rack-1.6.13
  rack-test-0.7.0
  json-2.3.0
  multi_json-1.15.0
  rack-protection-1.5.5
  tilt-2.0.10
  backports-3.23.0
  sinatra-1.4.8
  sinatra-contrib-1.4.7
  ffi-1.15.5
  rb-inotify-0.10.1
  rb-fsevent-0.11.0
  sass-listen-4.0.0
  sass-3.7.4
  puma-3.11.4
  asetus-0.3.0
  bcrypt_pbkdf-1.1.0
  ed25519-1.2.4
  net-ssh-5.2.0
  net-telnet-0.2.0
  rugged-0.28.5
  slop-4.9.1
  oxidized-0.28.0
  htmlentities-4.3.4
  temple-0.8.2
  haml-5.2.2
  emk-sinatra-url-for-0.2.1
  charlock_holmes-0.7.7
  oxidized-web-0.13.1
dwalin@oxidized-2004:~$ sudo gem search ^oxidized-script$

*** REMOTE GEMS ***

oxidized-script (0.7.0)
dwalin@oxidized-2004:~$ sudo gem search -r -a ^oxidized-script$

*** REMOTE GEMS ***

oxidized-script (0.7.0, 0.6.0, 0.5.1, 0.5.0, 0.4.0, 0.3.1, 0.3.0, 0.2.0, 0.1.2, 0.1.1, 0.1.0, 0.0.6, 0.0.4, 0.0.3, 0.0.2, 0.0.1)
dwalin@oxidized-2004:~$ sudo gem search -r -a ^oxidized-web$

*** REMOTE GEMS ***

oxidized-web (0.18.1, 0.18.0, 0.17.1, 0.17.0, 0.16.0, 0.15.1, 0.15.0, 0.14.0, 0.13.1, 0.13.0, 0.12.1, 0.12.0, 0.11.1, 0.11.0, 0.10.2, 0.10.1, 0.10.0, 0.9.3, 0.9.2, 0.9.1, 0.9.0, 0.8.0, 0.7.1, 0.7.0, 0.6.1, 0.6.0, 0.5.2, 0.5.1, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.2, 0.1.1, 0.1.0, 0.0.3, 0.0.2, 0.0.1)
dwalin@oxidized-2004:~$ sudo gem search -r -a ^oxidized$

*** REMOTE GEMS ***

oxidized (0.37.0, 0.36.0, 0.35.0, 0.34.3, 0.34.2, 0.34.1, 0.34.0, 0.33.0, 0.32.1, 0.32.0, 0.31.0, 0.30.1, 0.30.0, 0.29.1, 0.29.0, 0.28.0, 0.27.0, 0.26.3, 0.26.2, 0.26.1, 0.26.0, 0.25.1, 0.25.0, 0.24.0, 0.23.0, 0.22.0, 0.21.0, 0.20.0, 0.19.0, 0.18.0, 0.17.0, 0.16.3, 0.16.2, 0.16.1, 0.16.0, 0.15.0, 0.14.3, 0.14.2, 0.14.1, 0.14.0, 0.13.1, 0.13.0, 0.12.2, 0.12.1, 0.12.0, 0.11.0, 0.10.0, 0.9.0, 0.8.1, 0.8.0, 0.7.2, 0.7.1, 0.7.0, 0.6.0, 0.5.0, 0.4.1, 0.4.0, 0.3.0, 0.2.4, 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.1)

Misc 2

root@oxidized-2004:~/o# gem sources
*** CURRENT SOURCES ***

https://auul.pri.ee/repository/rubygems-group-public/
root@oxidized-2004:~/o# gem install oxidized --explain
Gems to install:
  asetus-0.3.0
  bcrypt_pbkdf-1.1.0
  ed25519-1.2.4
  net-ssh-5.2.0
  net-telnet-0.2.0
  rugged-0.28.5
  slop-4.9.1
  oxidized-0.28.0
root@oxidized-2004:~/o# gem sources --remove https://auul.pri.ee/repository/rubygems-group-public/
https://auul.pri.ee/repository/rubygems-group-public/ removed from sources

root@oxidized-2004:~/o# gem sources --add https://rubygems.org/
https://rubygems.org/ is too similar to https://rubygems.org

Do you want to add this source? [yn]  y
https://rubygems.org/ added to sources
root@oxidized-2004:~/o# gem sources c
*** CURRENT SOURCES ***

https://rubygems.org/
root@oxidized-2004:~/o# gem sources -c
*** Removed specs cache ***
root@oxidized-2004:~/o# gem sources
*** CURRENT SOURCES ***

https://rubygems.org/
root@oxidized-2004:~/o# gem install oxidized --explain
Gems to install:
  syslog_protocol-0.9.2
  logger-1.4.2
  syslog-0.4.0
  slop-4.10.1
  concurrent-ruby-1.3.6
  semantic_logger-4.18.0
  rugged-1.9.0
  date-3.0.0
  stringio-0.1.0
  psych-5.4.0
  net-telnet-0.2.0
  net-ssh-7.3.2
  net-http-digest_auth-1.4.1
  time-0.4.2
  timeout-0.1.0
  net-protocol-0.2.2
  net-ftp-0.3.9
  ed25519-1.4.0
  bcrypt_pbkdf-1.1.2
  asetus-0.4.0
  oxidized-0.37.0

root@oxidized-2004:~/o# gem install oxidized
Fetching rugged-1.9.0.gem
Fetching psych-5.4.0.gem
Fetching net-telnet-0.2.0.gem
Fetching semantic_logger-4.18.0.gem
Fetching slop-4.10.1.gem
Fetching syslog-0.4.0.gem
Fetching concurrent-ruby-1.3.6.gem
Fetching syslog_protocol-0.9.2.gem
Fetching net-ssh-7.3.2.gem
Fetching net-http-digest_auth-1.4.1.gem
Fetching time-0.4.2.gem
Fetching net-protocol-0.2.2.gem
Fetching net-ftp-0.3.9.gem
Fetching ed25519-1.4.0.gem
Fetching bcrypt_pbkdf-1.1.2.gem
Fetching asetus-0.4.0.gem
Fetching oxidized-0.37.0.gem
Successfully installed syslog_protocol-0.9.2
Building native extensions. This could take a while...
Successfully installed syslog-0.4.0
Successfully installed slop-4.10.1
Successfully installed concurrent-ruby-1.3.6
Successfully installed semantic_logger-4.18.0
Building native extensions. This could take a while...
Successfully installed rugged-1.9.0
Building native extensions. This could take a while...
ERROR:  Error installing oxidized:
	ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/psych-5.4.0/ext/psych
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20260609-9298-1g4pde2.rb extconf.rb
checking for yaml.h... no
yaml.h not found
*** 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.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
	--with-libyaml-source-dir
	--without-libyaml-source-dir
	--with-yaml-0.1-config
	--without-yaml-0.1-config
	--with-pkg-config
	--without-pkg-config
	--with-libyaml-dir
	--without-libyaml-dir
	--with-libyaml-include
	--without-libyaml-include=${libyaml-dir}/include
	--with-libyaml-lib
	--without-libyaml-lib=${libyaml-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/psych-5.4.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.7.0/gems/psych-5.4.0 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/psych-5.4.0/gem_make.out
root@oxidized-2004:~/o#

Kasulikud lisamaterjalid

  • TODO