Installed rubygems1.9.1 but it reports version 1.3.5 - ruby

I installed rubygems1.9.1 on a pretty clean Lucid VM.
$ sudo apt-get install rubygems1.9.1
...
The following extra packages will be installed:
irb1.9.1 libreadline-ruby1.9.1 libreadline5 rdoc1.9.1
Suggested packages:
graphviz build-essential rubygems-doc
The following NEW packages will be installed:
irb1.9.1 libreadline-ruby1.9.1 libreadline5 rdoc1.9.1 rubygems1.9.1
0 upgraded, 5 newly installed, 0 to remove and 85 not upgraded.
...
Get:1 http://archive.ubuntu.com/ubuntu/ lucid/main libreadline5 5.2-7build1 [147kB]
Get:2 http://archive.ubuntu.com/ubuntu/ lucid/universe libreadline-ruby1.9.1 1.9.1.378-1 [15.2kB]
Get:3 http://archive.ubuntu.com/ubuntu/ lucid/universe irb1.9.1 1.9.1.378-1 [66.9kB]
Get:4 http://archive.ubuntu.com/ubuntu/ lucid/universe rdoc1.9.1 1.9.1.378-1 [125kB]
Get:5 http://archive.ubuntu.com/ubuntu/ lucid/universe rubygems1.9.1 1.3.5-1ubuntu2 [191kB]
Fetched 545kB in 7s (76.2kB/s)
Selecting previously deselected package libreadline5.
(Reading database ... 29331 files and directories currently installed.)
Unpacking libreadline5 (from .../libreadline5_5.2-7build1_amd64.deb) ...
Selecting previously deselected package libreadline-ruby1.9.1.
Unpacking libreadline-ruby1.9.1 (from .../libreadline-ruby1.9.1_1.9.1.378-1_amd64.deb) ...
Selecting previously deselected package irb1.9.1.
Unpacking irb1.9.1 (from .../irb1.9.1_1.9.1.378-1_all.deb) ...
Selecting previously deselected package rdoc1.9.1.
Unpacking rdoc1.9.1 (from .../rdoc1.9.1_1.9.1.378-1_all.deb) ...
Selecting previously deselected package rubygems1.9.1.
Unpacking rubygems1.9.1 (from .../rubygems1.9.1_1.3.5-1ubuntu2_all.deb) ...
Processing triggers for man-db ...
Setting up libreadline5 (5.2-7build1) ...
Setting up libreadline-ruby1.9.1 (1.9.1.378-1) ...
Setting up irb1.9.1 (1.9.1.378-1) ...
Setting up rdoc1.9.1 (1.9.1.378-1) ...
Setting up rubygems1.9.1 (1.3.5-1ubuntu2) ...
Yet, bizarrely:
$ gem1.9.1 --version
1.3.5
$ cat /usr/bin/gem1.9.1
#!/usr/bin/ruby1.9.1
...
I'm not really sure if this is a packaging problem or a Ruby problem.
I need Gems > 1.8 to install another package.

gem update --system is a good starting point for making sure you're at the highest version of Rubygems. If your version doesn't support it then you'll need to bootstrap it, because that capability hasn't always been available.
Personally, I never use the repos for my Ruby/Python/Perl installations, instead I make sure I have the needed dependencies, then compile from source.
Consider installing rbenv or RVM and let it manage your Ruby installations. RVM has more features and is more intrusive. rbenv is simpler with fewer features -- personally I use rbenv.

Related

How to install version specified Ruby using apt

I tried to install Ruby with version specified 2.5.1 (the version is just example), and tried following script, but I got an error as follows. Is it possible to install Ruby with a version using apt installing so I can deal with Ruby version dependency issue?
$ sudo apt update ; sudo apt install ruby-full=2.5.1
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Get:2 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://ppa.launchpad.net/kelleyk/emacs/ubuntu bionic InRelease
Hit:5 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:6 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:7 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:8 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
Hit:9 http://ppa.launchpad.net/teejee2008/timeshift/ubuntu bionic InRelease
Fetched 64.4 kB in 2s (41.9 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
40 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '2.5.1' for 'ruby-full' was not found
You can install rbenv which is a Ruby Environment and then you can install the version of Ruby you want over it.
Refer to this answer.
The specific version of ruby you want to install has to be a package available in your Ubuntu distro's package repository. A quick way to check this is using apt list | grep ruby-full or apt list | grep ruby.
If you don't find the version you're looking for, you can add a repository and download it from there. Brightbox is a widely used repository maintaining several ruby version packages. Their installation docs should help you.
Note: I still recommend that you use a ruby version manager like rbenv or rvm.

Upgrading python version on Bash on Ubuntu on Windows?

so I'm currently trying to upgrade the python version in the bash on ubuntu on windows subsystem. However from my understanding it is not easy to update python from the command line. Lastly, "where" exactly is my unix subsystem? For example, is there something like a unix portion on my file system, where I can just drag files into? Thanks
It is an older question, however I had to do the same thing today (use python3.6 on my windows 10 laptop).
Press Windows + R (to open the run command dialog)
Type: bash + press Enter
You will get a new windows bash prompt window.
Type first lsb_release -a to check that you run the latest bash/ubuntu environment on your Windows Machine (might be ubuntu 14.04, while 16.04 is the current one).
raz#HOSTNAME:~/myPlayground$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
If you are running an older version upgrade by running do-release-upgrade
raz#HOSTNAME:~/myPlayground$ sudo do-release-upgrade
[sudo] password for raz:
Checking for a new Ubuntu release
No new release found.
Add the PPA custom repository (the standard apt repos have only 3.5 for now)
raz#HOSTNAME:~/myPlayground$ sudo add-apt-repository ppa:jonathonf/python-3.6
A plain backport of *just* Python 3.6. System extensions/Python libraries may or may not work.
Don't remove Python 3.5 from your system - it will break.
More info: https://launchpad.net/~jonathonf/+archive/ubuntu/python-3.6
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmp5vq72la1/secring.gpg' created
gpg: keyring `/tmp/tmp5vq72la1/pubring.gpg' created
gpg: requesting key F06FC659 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp5vq72la1/trustdb.gpg: trustdb created
gpg: key F06FC659: public key "Launchpad PPA for J Fernyhough" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
Update the apt information:
raz#HOSTNAME:~/myPlayground$ sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:3 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease [18.0 kB]
Get:4 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages [4,760 B]
Get:5 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en [2,128 B]
Get:6 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Fetched 241 kB in 10s (22.2 kB/s)
Reading package lists... Done
Finally install python3.6:
raz#HOSTNAME:~/myPlayground$ sudo apt-get install python3.6
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpython3.6-minimal libpython3.6-stdlib python3.6-minimal
Suggested packages:
python3.6-venv python3.6-doc binfmt-support
The following NEW packages will be installed:
libpython3.6-minimal libpython3.6-stdlib python3.6 python3.6-minimal
0 upgraded, 4 newly installed, 0 to remove and 3 not upgraded.
Need to get 4,505 kB of archives.
After this operation, 23.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 libpython3.6-minimal amd64 3.6.5-5~16.04.york1 [574 kB]
Get:2 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 python3.6-minimal amd64 3.6.5-5~16.04.york1 [1,712 kB]
Get:3 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 libpython3.6-stdlib amd64 3.6.5-5~16.04.york1 [1,989 kB]
Get:4 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 python3.6 amd64 3.6.5-5~16.04.york1 [230 kB]
Fetched 4,505 kB in 4s (979 kB/s)
Selecting previously unselected package libpython3.6-minimal:amd64.
(Reading database ... 31944 files and directories currently installed.)
Preparing to unpack .../libpython3.6-minimal_3.6.5-5~16.04.york1_amd64.deb ...
Unpacking libpython3.6-minimal:amd64 (3.6.5-5~16.04.york1) ...
Selecting previously unselected package python3.6-minimal.
Preparing to unpack .../python3.6-minimal_3.6.5-5~16.04.york1_amd64.deb ...
Unpacking python3.6-minimal (3.6.5-5~16.04.york1) ...
Selecting previously unselected package libpython3.6-stdlib:amd64.
Preparing to unpack .../libpython3.6-stdlib_3.6.5-5~16.04.york1_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.5-5~16.04.york1) ...
Selecting previously unselected package python3.6.
Preparing to unpack .../python3.6_3.6.5-5~16.04.york1_amd64.deb ...
Unpacking python3.6 (3.6.5-5~16.04.york1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up libpython3.6-minimal:amd64 (3.6.5-5~16.04.york1) ...
Setting up python3.6-minimal (3.6.5-5~16.04.york1) ...
Setting up libpython3.6-stdlib:amd64 (3.6.5-5~16.04.york1) ...
Setting up python3.6 (3.6.5-5~16.04.york1) ...
raz#HOSTNAME:~/myPlayground$
Check your python versions:
raz#HOSTNAME:~/myPlayground$ python -V
Python 2.7.12
raz#HOSTNAME:~/myPlayground$ python3 -V
Python 3.5.2
raz#HOSTNAME:~/myPlayground$ python3.6 -V
Python 3.6.5
You can search your 'Start Menu' for 'Bash' and get the app that will open a command prompt from within Ubuntu Linux (not Unix).
AFAIK you cannot drag and drop into this from Explorer.exe but you may be able to run a Linux file app that can do this with X11 installed.
Finally, from Bash on Ubuntu command line app, you can run 'sudo apt-get install python3' to get latest for Ubuntu.

getting command not found when middleman is called

Hi I have installed ruby in my ubuntu 16.04 and successfully installed, and also installed middleman to check my project its worked properly, when I reconnect to middleman I got error middleman: command not found I am not getting what the mistake is. when I try to re initialise it, it asks to install ruby. please help someone to know the exact error.
urujada#gurujada-To-be-filled-by-O-E-M:~$ cd sunil
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ atom .
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ middleman
middleman: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ middleman
middleman: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ middleman init
middleman: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ cd Home
bash: cd: Home: No such file or directory
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ cd..
cd..: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/sunil$ cd ..
gurujada#gurujada-To-be-filled-by-O-E-M:~$ cd Home
bash: cd: Home: No such file or directory
gurujada#gurujada-To-be-filled-by-O-E-M:~$ mkdir example
gurujada#gurujada-To-be-filled-by-O-E-M:~$ cd example
gurujada#gurujada-To-be-filled-by-O-E-M:~/example$ middleman init
middleman: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/example$ cd ..
gurujada#gurujada-To-be-filled-by-O-E-M:~$ gem install middleman
The program 'gem' is currently not installed. You can install it by typing:
sudo apt install ruby
gurujada#gurujada-To-be-filled-by-O-E-M:~$ sudo apt install ruby
[sudo] password for gurujada:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fonts-lato javascript-common libjs-jquery libruby2.3 rake ruby-did-you-mean
ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3
rubygems-integration
Suggested packages:
apache2 | lighttpd | httpd ri ruby-dev bundler
The following NEW packages will be installed:
fonts-lato javascript-common libjs-jquery libruby2.3 rake ruby
ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert
ruby-test-unit ruby2.3 rubygems-integration
0 upgraded, 13 newly installed, 0 to remove and 11 not upgraded.
Need to get 6,042 kB of archives.
After this operation, 27.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 fonts-lato all 2.0-1 [2,693 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 javascript-common all 11 [6,066 B]
Get:3 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 libjs-jquery all 1.11.3+dfsg-4 [161 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 rubygems-integration all 1.10 [4,966 B]
Get:5 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby-did-you-mean all 1.0.0-2 [8,390 B]
Get:6 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby-minitest all 5.8.4-2 [36.6 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby-net-telnet all 0.1.1-2 [12.6 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby-power-assert all 0.2.7-1 [7,668 B]
Get:9 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby-test-unit all 3.1.7-2 [60.3 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libruby2.3 amd64 2.3.1-2~16.04 [2,957 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 ruby2.3 amd64 2.3.1-2~16.04 [40.9 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 ruby all 1:2.3.0+1 [5,530 B]
Get:13 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 rake all 10.5.0-2 [48.2 kB]
Fetched 6,042 kB in 25s (239 kB/s)
Selecting previously unselected package fonts-lato.
(Reading database ... 211722 files and directories currently installed.)
Preparing to unpack .../fonts-lato_2.0-1_all.deb ...
Unpacking fonts-lato (2.0-1) ...
Selecting previously unselected package javascript-common.
Preparing to unpack .../javascript-common_11_all.deb ...
Unpacking javascript-common (11) ...
Selecting previously unselected package libjs-jquery.
Preparing to unpack .../libjs-jquery_1.11.3+dfsg-4_all.deb ...
Unpacking libjs-jquery (1.11.3+dfsg-4) ...
Selecting previously unselected package rubygems-integration.
Preparing to unpack .../rubygems-integration_1.10_all.deb ...
Unpacking rubygems-integration (1.10) ...
Selecting previously unselected package ruby-did-you-mean.
Preparing to unpack .../ruby-did-you-mean_1.0.0-2_all.deb ...
Unpacking ruby-did-you-mean (1.0.0-2) ...
Selecting previously unselected package ruby-minitest.
Preparing to unpack .../ruby-minitest_5.8.4-2_all.deb ...
Unpacking ruby-minitest (5.8.4-2) ...
Selecting previously unselected package ruby-net-telnet.
Preparing to unpack .../ruby-net-telnet_0.1.1-2_all.deb ...
Unpacking ruby-net-telnet (0.1.1-2) ...
Selecting previously unselected package ruby-power-assert.
Preparing to unpack .../ruby-power-assert_0.2.7-1_all.deb ...
Unpacking ruby-power-assert (0.2.7-1) ...
Selecting previously unselected package ruby-test-unit.
Preparing to unpack .../ruby-test-unit_3.1.7-2_all.deb ...
Unpacking ruby-test-unit (3.1.7-2) ...
Selecting previously unselected package libruby2.3:amd64.
Preparing to unpack .../libruby2.3_2.3.1-2~16.04_amd64.deb ...
Unpacking libruby2.3:amd64 (2.3.1-2~16.04) ...
Selecting previously unselected package ruby2.3.
Preparing to unpack .../ruby2.3_2.3.1-2~16.04_amd64.deb ...
Unpacking ruby2.3 (2.3.1-2~16.04) ...
Selecting previously unselected package ruby.
Preparing to unpack .../ruby_1%3a2.3.0+1_all.deb ...
Unpacking ruby (1:2.3.0+1) ...
Selecting previously unselected package rake.
Preparing to unpack .../archives/rake_10.5.0-2_all.deb ...
Unpacking rake (10.5.0-2) ...
Processing triggers for fontconfig (2.11.94-0ubuntu1.1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up fonts-lato (2.0-1) ...
Setting up javascript-common (11) ...
Setting up libjs-jquery (1.11.3+dfsg-4) ...
Setting up rubygems-integration (1.10) ...
Setting up ruby-did-you-mean (1.0.0-2) ...
Setting up ruby-minitest (5.8.4-2) ...
Setting up ruby-net-telnet (0.1.1-2) ...
Setting up ruby-power-assert (0.2.7-1) ...
Setting up ruby-test-unit (3.1.7-2) ...
Setting up libruby2.3:amd64 (2.3.1-2~16.04) ...
Setting up ruby2.3 (2.3.1-2~16.04) ...
Setting up ruby (1:2.3.0+1) ...
Setting up rake (10.5.0-2) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
gurujada#gurujada-To-be-filled-by-O-E-M:~$ gem install middleman
Fetching: bundler-1.12.5.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /var/lib/gems/2.3.0 directory.
gurujada#gurujada-To-be-filled-by-O-E-M:~$ cd example
gurujada#gurujada-To-be-filled-by-O-E-M:~/example$ middleman init
middleman: command not found
gurujada#gurujada-To-be-filled-by-O-E-M:~/example$ cd ..
gurujada#gurujada-To-be-filled-by-O-E-M:~$ ruby -v
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
gurujada#gurujada-To-be-filled-by-O-E-M:~$ whereis ruby
ruby: /usr/bin/ruby /usr/bin/ruby2.3 /usr/lib/ruby /usr/share/man/man1/ruby.1.gz
gurujada#gurujada-To-be-filled-by-O-E-M:~$
From your log:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /var/lib/gems/2.3.0 directory.
Middleman was not successfully installed because your user can't write to the directory it should be installed in.
You have two easy options:
run sudo gem install middleman
run sudo gem install bundler, and then in your project directory, create a Gemfile with the following content:
source "https://rubygems.org"
gem "middleman", "~> 4.1"
and run bundle install in the project directory.
You should really do option 2 so you can keep multiple version of gems installed.
You could also not use the system Ruby and install one yourself with RVM or rbenv, but that is a little more work.

pkg-config --version always gives 0.26

So, was reading about pkg-config (I think it's included by default on Debian, which I'm on). But every time I try to find the version for something, it gives me 0.26.
santeyio#Amadeus:/$ pkg-config --version python
0.26
santeyio#Amadeus:/$ pkg-config --version libre-office
0.26
santeyio#Amadeus:/$ pkg-config --version alsdkfj
0.26
santeyio#Amadeus:/$ pkg-config --version firefox
0.26
santeyio#Amadeus:/$
So, I tried sudo apt-get removing it, then installing it again. But I get the same results. I know I'm missing something stupid here... can anyone point me in the right direction?
Here's the output from my re-installing, if that's helpful...
santeyio#Amadeus:/$ sudo apt-get install pkg-config
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
calligra-l10n-engb cdparanoia comerr-dev k3b k3b-data k3b-i18n kdevelop-php-docs-l10n
kdevelop-php-l10n krb5-multidev language-pack-kde-en libasprintf0c2:i386 libcroco3:i386
libgcrypt11-dev libgnutls-dev libgnutls-openssl27 libgnutlsxx27 libgomp1:i386 libgpg-error-dev
libgssrpc4 libk3b6 libkadm5clnt-mit8 libkadm5srv-mit8 libkcddb4 libkdb5-6 libkrb5-dev libldap2-dev
libp11-kit-dev librtmp-dev libtasn1-3-dev linux-headers-3.5.0-17 postgresql-client-9.2
postgresql-common python-xkit screen-resolution-extra
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
pkg-config
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 41.3 kB of archives.
After this operation, 136 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ quantal/main pkg-config amd64 0.26-1ubuntu2 [41.3 kB]
Fetched 41.3 kB in 0s (66.2 kB/s)
Selecting previously unselected package pkg-config.
(Reading database ... 247983 files and directories currently installed.)
Unpacking pkg-config (from .../pkg-config_0.26-1ubuntu2_amd64.deb) ...
Processing triggers for man-db ...
Setting up pkg-config (0.26-1ubuntu2) ...
Use --modversion.
$ pkg-config --modversion python
2.7
pkg-config is meant to be used when compiling against a library -- if you're trying to check the version of a package, use dpkg -s
$ dpkg -s firefox
Package: firefox
Status: install ok installed
Priority: optional
Section: web
Installed-Size: 48531
Maintainer: Ubuntu Mozilla Team <ubuntu-mozillateam#lists.ubuntu.com>
Architecture: amd64
Version: 17.0.1+build1-0ubuntu0.12.04.1
Or apt-cache policy
$ apt-cache policy firefox
firefox:
Installed: 17.0.1+build1-0ubuntu0.12.04.1
Candidate: 20.0+build1-0ubuntu0.12.04.3
...

Installing Ruby-Gnome2 on Ubuntu with RVM

I have RVM running and it is working brilliantly, but I can't seem to figure out how to install ruby-gnome2. I have followed the steps on this tutorial, which are:
rvm use 1.9.1 # I use 1.9.1 which should work with ruby-gnome2
wget http://downloads.sourceforge.net/ruby-gnome2/ruby-gnome2-all-0.19.4.tar.gz
tar zxf ruby-gnome2-all-0.19.4.tar.gz
cd ruby-gnome2-all-0.19.4/
ruby extconf.rb —ruby=`which ruby`
make
make install
This produces no errors, so I assume it worked. So I try to test it with:
$ irb
irb(main):001:0> require 'gtk2'
Which gives me this error:
irb(main):001:0> require 'gtk2'
LoadError: no such file to load -- gtk2
Why am I not able to install ruby-gnome2?
Install system dependecies:
sudo apt-get install libglib2.0-dev libatk1.0-dev libcairo-dev
libsqlite3-dev libpango1.0-dev libgtk2.0-dev libgdk-pixbuf2.0
Install gtk2 gem which is ruby-gnome2:
gem install gtk2
You can run this tiny script to verify that gtk2 is installed:
require 'gtk2'
win = Gtk::Window.new("My ruby-gnome2 project")
win.show_all
Gtk.main
I hope that, when you followed those instructions, on the line:
ruby extconf.rb —ruby=`which ruby`
You actually:
used two dashes -- (the code in the page replaced those two dashes with a long one)
replaced the `which ruby` (note the backticks) with the actual output of running that command on your OS (with no backticks)
If not, that's your error.
If you actually did all those, please post the output you got from the ruby extconf.rb ... line.
In order to build ruby-gnome2 for RVM with all dependencies, ensure the following packages are installed before you build your ruby binary:
sudo apt-get install libatk1.0-dev libpanel-applet-4-dev libgtksourceview2.0-dev libvte-dev libgstreamer0.10-dev libbonobo2-dev libbonoboui2-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libgtksourceview2.0-dev libpango1.0-dev libpoppler-dev libglade2-dev libart-2.0-dev libgnomeprint2.2-dev libgnomecanvas2-dev libgtkglext1-dev libgnomeprintui2.2-dev libgoocanvas-dev libgnomevfs2-dev libgconf2-dev librsvg2-dev
You can rebuild it again after installing these with:
rvm install 1.9.1
Then, follow the instructions you posted:
rvm use 1.9.1 # I use 1.9.1 which should work with ruby-gnome2
wget http://downloads.sourceforge.net/ruby-gnome2/ruby-gnome2-all-0.19.4.tar.gz
tar zxf ruby-gnome2-all-0.19.4.tar.gz
cd ruby-gnome2-all-0.19.4/
ruby extconf.rb —ruby=`which ruby`
# Alternatively you may use the following line
# to install into rvm's dir and avoid conflict with system libs
# ruby extconf.rb --ruby=`which ruby` --prefix=$MY_RUBY_HOME
make
make install
I need gtk2 in rvm on ubuntu 14.04.1 with ruby 2.1.2
(~)$ pdfwalker
Error: you need to install ruby-gtk2 to run this application
So get all the requirements
sudo apt-get install ruby-gtk2
Watch it install
(~)$ sudo apt-get install ruby-gtk2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gambas3-gb-form-stock kde-l10n-engb libp11-kit-gnome-keyring:i386
wine-gecko2.21 wine-gecko2.21:i386 wine-mono0.0.8
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libruby1.9.1 libruby2.0 ruby ruby-atk ruby-cairo ruby-gdk-pixbuf2 ruby-glib2
ruby-gobject-introspection ruby-pango ruby1.9.1 ruby2.0 rubygems-integration
Suggested packages:
ri ruby-dev ruby1.9.1-examples ri1.9.1 graphviz ruby1.9.1-dev ruby-switch
bundler
The following NEW packages will be installed:
libruby1.9.1 libruby2.0 ruby ruby-atk ruby-cairo ruby-gdk-pixbuf2 ruby-glib2
ruby-gobject-introspection ruby-gtk2 ruby-pango ruby1.9.1 ruby2.0
rubygems-integration
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,579 kB of archives.
After this operation, 31.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main ruby all 1:1.9.3.4 [5,334 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/main ruby1.9.1 amd64 1.9.3.484-2ubuntu1 [35.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty/main libruby1.9.1 amd64 1.9.3.484-2ubuntu1 [2,667 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main rubygems-integration all 1.5 [5,340 B]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main ruby2.0 amd64 2.0.0.484-1ubuntu2 [66.5 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty/main libruby2.0 amd64 2.0.0.484-1ubuntu2 [2,807 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-glib2 amd64 2.1.0-1 [133 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-atk amd64 2.1.0-1 [26.4 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-cairo amd64 1.12.8-1 [96.5 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-gdk-pixbuf2 amd64 2.1.0-1 [25.9 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-gobject-introspection amd64 2.1.0-1 [38.9 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-pango amd64 2.1.0-1 [53.0 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu/ trusty/universe ruby-gtk2 amd64 2.1.0-1 [619 kB]
Fetched 6,579 kB in 17s (367 kB/s)
Selecting previously unselected package ruby.
(Reading database ... 277672 files and directories currently installed.)
Preparing to unpack .../ruby_1%3a1.9.3.4_all.deb ...
Unpacking ruby (1:1.9.3.4) ...
Selecting previously unselected package ruby1.9.1.
Preparing to unpack .../ruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ...
Unpacking ruby1.9.1 (1.9.3.484-2ubuntu1) ...
Selecting previously unselected package libruby1.9.1.
Preparing to unpack .../libruby1.9.1_1.9.3.484-2ubuntu1_amd64.deb ...
Unpacking libruby1.9.1 (1.9.3.484-2ubuntu1) ...
Selecting previously unselected package rubygems-integration.
Preparing to unpack .../rubygems-integration_1.5_all.deb ...
Unpacking rubygems-integration (1.5) ...
Selecting previously unselected package ruby2.0.
Preparing to unpack .../ruby2.0_2.0.0.484-1ubuntu2_amd64.deb ...
Unpacking ruby2.0 (2.0.0.484-1ubuntu2) ...
Selecting previously unselected package libruby2.0:amd64.
Preparing to unpack .../libruby2.0_2.0.0.484-1ubuntu2_amd64.deb ...
Unpacking libruby2.0:amd64 (2.0.0.484-1ubuntu2) ...
Selecting previously unselected package ruby-glib2.
Preparing to unpack .../ruby-glib2_2.1.0-1_amd64.deb ...
Unpacking ruby-glib2 (2.1.0-1) ...
Selecting previously unselected package ruby-atk.
Preparing to unpack .../ruby-atk_2.1.0-1_amd64.deb ...
Unpacking ruby-atk (2.1.0-1) ...
Selecting previously unselected package ruby-cairo.
Preparing to unpack .../ruby-cairo_1.12.8-1_amd64.deb ...
Unpacking ruby-cairo (1.12.8-1) ...
Selecting previously unselected package ruby-gdk-pixbuf2.
Preparing to unpack .../ruby-gdk-pixbuf2_2.1.0-1_amd64.deb ...
Unpacking ruby-gdk-pixbuf2 (2.1.0-1) ...
Selecting previously unselected package ruby-gobject-introspection.
Preparing to unpack .../ruby-gobject-introspection_2.1.0-1_amd64.deb ...
Unpacking ruby-gobject-introspection (2.1.0-1) ...
Selecting previously unselected package ruby-pango.
Preparing to unpack .../ruby-pango_2.1.0-1_amd64.deb ...
Unpacking ruby-pango (2.1.0-1) ...
Selecting previously unselected package ruby-gtk2.
Preparing to unpack .../ruby-gtk2_2.1.0-1_amd64.deb ...
Unpacking ruby-gtk2 (2.1.0-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up ruby (1:1.9.3.4) ...
Setting up libruby1.9.1 (1.9.3.484-2ubuntu1) ...
Setting up rubygems-integration (1.5) ...
Setting up ruby2.0 (2.0.0.484-1ubuntu2) ...
Setting up libruby2.0:amd64 (2.0.0.484-1ubuntu2) ...
Setting up ruby-glib2 (2.1.0-1) ...
Setting up ruby-atk (2.1.0-1) ...
Setting up ruby-cairo (1.12.8-1) ...
Setting up ruby-gdk-pixbuf2 (2.1.0-1) ...
Setting up ruby-gobject-introspection (2.1.0-1) ...
Setting up ruby-pango (2.1.0-1) ...
Setting up ruby-gtk2 (2.1.0-1) ...
Setting up ruby1.9.1 (1.9.3.484-2ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.3) ...
Pop into RVM
rvm use 2.1.2
gem install gtk2
Watch the install happen
(~)$ gem install gtk2
Fetching: pkg-config-1.1.5.gem (100%)
Successfully installed pkg-config-1.1.5
Fetching: glib2-2.2.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed glib2-2.2.0
Fetching: atk-2.2.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed atk-2.2.0
Fetching: cairo-1.12.9.gem (100%)
Building native extensions. This could take a while...
Successfully installed cairo-1.12.9
Fetching: pango-2.2.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed pango-2.2.0
Fetching: gdk_pixbuf2-2.2.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed gdk_pixbuf2-2.2.0
Fetching: gtk2-2.2.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed gtk2-2.2.0
7 gems installed
Fireup your app.
pdfwalker

Resources