You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a set of bindings for the GNOME 3.x and 4.x libraries to use
from Ruby that allows you to write graphical user interfaces in Ruby.
Installation Instructions for gtk3 and gtk4
Debian/Ubuntu
Ruby can be run from the system directories, or from your home
directory, or both. Most people won't have the correct permissions
for a system install, so the vast majority of people to run Ruby from
their local, /home/... directory.
To test if your copy of Ruby is running locally enter this on the
command line:
which ruby
If it outputs something like this:
/home/ralph/.rbenv/shims/ruby
that starts with /home/, that's local (good!)
But if outputs something like this:
/usr/bin/ruby
That is a system directory, and the gtk4 gem will fail to install.
Actually, a system administrator with super-user permissions could
install everything in the system folders (see advanced install), but
its much better for everyone else to run Ruby locally.
If you're already running a copy of Ruby under your home directory,
you can install gtk4 (or gtk3):
gem install gtk4
But if you're running ruby from the system folders, you can install a
Ruby version manager like RVM or
rbenv. These programs allow you to
run multiple versions of Ruby from your home directory.
rbenv has a
rbenv-installer that
installs everything and adds a line to your .bashrc file so you're
running local copies of Ruby.
To get rbenv:
Run the installer
Restart your command prompt
Run rbenv install --list (find recent Ruby version)
Run rbenv install 3.3.5 (example version. choose one from list)
Run which ruby (check that its running from home directory)
If that works, then you're ready to install gtk4 (or gtk3):
gem install gtk4
macOS
Input needed...
Windows
In Windows, the gem should be installed without issue. If you install
Ruby using the Ruby Installer, make sure
that MSYS2 gets installed too. GTK needs MSYS2 to make the binary
files. Then, at the Ruby command prompt:
This program is free software.
You can distribute/modify this program under the terms of
the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
Exceptions
Some GTK+ 3 examples are licensed under GNU Free Documentation License
1.3 or any later version later; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts.