qtbindingsでwebviewを使う

Post date: 2018/07/28 10:22:43

というかqtwebkitをqtbindingsに組み込む。ubuntu 16.04ベース(多分)で実施。

apt-get install libqtwebkit-dev

qtbindignsは、最新版が4.8.6.5になっていた。

require 'Qt' のあとに、require 'qtwebkit'

2019/3/4追記 ubuntu 16.04へのqtbindings-4.8.6.4のインストール

ruby alta.rb

普通にインスチールしたら以下のエラー

Traceback (most recent call last):

6: from alta.rb:33:in `<main>'

5: from /opt/chef-workstation/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_requ\

ire.rb:39:in `require'

4: from /opt/chef-workstation/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_requ\

ire.rb:135:in `rescue in require'

3: from /opt/chef-workstation/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_requ\

ire.rb:135:in `require'

2: from /opt/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.4/\

lib/Qt4.rb:25:in `<top (required)>'

1: from /opt/chef-workstation/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_requ\

ire.rb:59:in `require'

/opt/chef-workstation/embedded/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': libqtruby4shared.so.2: cannot open shared object file: No such file or directory - /opt/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.4/lib/2.5/qtruby4.so (LoadError)

ldd /opt/chef-workstation/embedded/lib/ruby/gems/2.5.0/gems/qtbindings-4.8.6.4/lib/2.5/qtruby4.so すると、以下が無いことがわかった:


libqtruby4shared.so.2 => not found

libsmokeqtxml.so.3 => not found

libsmokeqtopengl.so.3 => not found

libsmokeqtsql.so.3 => not found

libsmokeqtnetwork.so.3 => not found

libsmokeqtdbus.so.3 => not found

libsmokeqtsvg.so.3 => not found

libsmokeqtgui.so.3 => not found

libsmokeqtcore.so.3 => not found

libsmokebase.so.3 => not found

以下をインストールすれば解決した:(apt-file search libsmokeqtcore.so.3 などしてわかった)

apt-get install libsmokeqt4-dev

apt-get install libqtruby4shared2