instiki
instiki copied to clipboard
Windows 10 run failure caused by install problem (iconv is missing)
I'm trying to run Instiki under Windows 10.
Downloading and installation seem to work fine, but when I run it (instiki --daemon
) it complains that iconv
doesn't exist.
[ I had tried doing this about a year ago using Ruby200 and had the same problem. For this attempt I uninstalled and deleted all the old ruby stuff, installed 2.3.1p112, and put Instiki in a fresh directory ]
My particular steps:
- I git cloned http://github.com/parasew/instiki.git (Latest commit e145916 2016-07-12)
- I installed ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
- I executed
DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
, inited and installed it.-
ruby dk.rb init
-
ruby dk.rb install
-
- I ruby installed Instiki:
ruby bundle install --path vendor/bundle
Comparing the output of this install with that shown in issue #36, (Error on start after installation), I find that my output is missing the line:
Using iconv 1.0.4
and has the line
Using rake 11.2.2
instead of
Using rake 10.4.2
I tried changing the Gemfile
line
gem "rake"
to
gem "rake", "10.4.2"
but that doesn't help.
The Gemfile might need an edit of the line
gem 'iconv', :platforms => [:ruby_20, :ruby_21, :ruby_22, :ruby_23]
but I have no experience with Ruby and don't know what to do.
Stack Overflow says for some case to add
gem "iconv", "~> 1.0.3"
which is Greek to me. Then again it also says
iconv has been deprecated for a while. It is replaced by (builtin) String#encode
but then again I have no idea what needs to be fixed.
Here is a full log of my attempt (in the "start command prompt with Ruby" shell). I ruby installed instiki twice so that the 2nd time it would just display Using
statements.
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
C:\nLab\rubyDevKit>ruby dk.rb init
[INFO] found RubyInstaller v2.3.1 at C:/Ruby23
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
C:\nLab\rubyDevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby23'
[INFO] Installing 'C:/Ruby23/lib/ruby/site_ruby/devkit.rb'
C:\nLab\rubyDevKit>cd C:\nLab\instiki2.git
C:\nLab\instiki2.git>ruby bundle install --path vendor/bundle
Fetching git://github.com/distler/maruku.git
Checking out files: 100% (280/280), done.
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..
Resolving dependencies...
Installing rake 11.2.2
Installing RedCloth 4.3.2 with native extensions
Installing abstract 1.0.0
Installing daemons 1.2.3
Installing erubis 2.7.0
Installing eventmachine 1.2.0.1
Installing file_signature 1.2.0
Installing itextomml 1.5.2 with native extensions
Using json 1.8.3
Installing nokogiri 1.5.11
Installing syntax 1.1.0
Installing rack 1.4.5
Installing rails_xss 0.4.0
Installing rubyzip 0.9.9
Installing sqlite3 1.3.11
Installing test-unit 2.5.5
Using bundler 1.11.2
Installing rdoc 4.2.2
Using maruku 0.7.3.beta1 from git://github.com/distler/maruku.git (at nokogiri@c67cc83)
Installing thin 1.7.0 with native extensions
Bundle complete! 19 Gemfile dependencies, 20 gems now installed.
Bundled gems are installed into ./vendor/bundle.
Post-install message from rdoc:
Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported
= 1.8.7 : gem install rdoc-data; rdoc-data --install
= 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
C:\nLab\instiki2.git>ruby bundle install --path vendor/bundle
Using rake 11.2.2
Using RedCloth 4.3.2
Using abstract 1.0.0
Using daemons 1.2.3
Using erubis 2.7.0
Using eventmachine 1.2.0.1
Using file_signature 1.2.0
Using itextomml 1.5.2
Using json 1.8.3
Using nokogiri 1.5.11
Using syntax 1.1.0
Using rack 1.4.5
Using rails_xss 0.4.0
Using rubyzip 0.9.9
Using sqlite3 1.3.11
Using test-unit 2.5.5
Using bundler 1.11.2
Using rdoc 4.2.2
Using maruku 0.7.3.beta1 from git://github.com/distler/maruku.git (at nokogiri@c67cc83)
Using thin 1.7.0
Bundle complete! 19 Gemfile dependencies, 20 gems now installed.
Bundled gems are installed into ./vendor/bundle.
C:\nLab\instiki2.git>instiki --daemon
C:\nLab\instiki2.git>set PATH=.\lib\native\win32;C:\Ruby23\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Ruby23\bin;C:\nLab\Ruby200\bin;C:\Program Files\Git\cmd
C:\nLab\instiki2.git>ruby.exe script\server -e production
C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/inflector.rb:3:in `require': cannot load such file -- iconv (LoadError)
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/inflector.rb:3:in `<top (required)>'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:in `require'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:in `<top (required)>'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb:2:in `require'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb:2:in `<top (required)>'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in `require'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in `block in <top (required)>'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in `each'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in `<top (required)>'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support.rb:56:in `require'
from C:/nLab/instiki2.git/vendor/rails/activesupport/lib/active_support.rb:56:in `<top (required)>'
from script/server:7:in `require'
from script/server:7:in `<main>'
C:\nLab\instiki2.git>
Thanks, but that doesn't work though it gives different errors.
I first tried patching the Gemfile with your changes but an attempted install failed. I then cloned a fresh instiki.git and got the same result.
The relevant lines in the install attempt log seem to be:
Installing iconv 1.0.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I tried some other things and then attempted the log suggestion
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/iconv-1.0.4/mkmf.log
but that file doesn't exist (maybe intermediate things I did cleared it).
The log also suggests:
Make sure that
gem install iconv -v '1.0.4'
succeeds before bundling.
When I tried that (and it failed) something strange happened. Windows security popped up:
This had never happened before, and it didn't happen the 2nd time I tried gem install iconv -v '1.0.4'
.
Here is the simple log of my current failure:
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
C:\Users\Rod>cd C:\nLab\instiki3.git
C:\nLab\instiki3.git>ruby bundle install --path vendor/bundle
Fetching git://github.com/distler/maruku.git
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..
Resolving dependencies...
Installing rake 10.4.2
Installing RedCloth 4.3.2 with native extensions
Installing abstract 1.0.0
Installing daemons 1.2.3
Installing erubis 2.7.0
Installing eventmachine 1.2.0.1
Installing file_signature 1.2.0
Installing iconv 1.0.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/ext/iconv
C:/Ruby23/bin/ruby.exe -r ./siteconf20160726-5904-1ue22r8.rb extconf.rb
checking for rb_enc_get() in ruby/encoding.h... yes
checking for rb_sys_fail_str() in ruby.h... yes
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... no
*** 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=C:/Ruby23/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/iconv-1.0.4/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4 for inspection.
Results logged to C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/iconv-1.0.4/gem_make.out
Installing itextomml 1.5.2 with native extensions
Using json 1.8.3
Installing nokogiri 1.5.11
Installing syntax 1.1.0
Installing rack 1.4.5
Installing rails_xss 0.4.0
Installing rubyzip 0.9.9
Installing sqlite3 1.3.11
Installing test-unit 2.5.5
Using bundler 1.11.2
An error occurred while installing iconv (1.0.4), and Bundler cannot continue.
Make sure that `gem install iconv -v '1.0.4'` succeeds before bundling.
C:\nLab\instiki3.git>
If you google
iconv gem windows
you will find numerous hits, describing exactly your problem. The solutions seem to differ, but this is clearly a Windows Ruby problem.
If you figure out which solution works for you, perhaps you might consider adding to the Instiki documentation.
Did Instiki ever work under Windows or was that just wishful thinking? In particular, if I manage to track down the iconv
problem and get Instiki to ruby install will I run into all sorts of other problems when I try instiki --daemon
(further error messages or it runs but doesn't respond to http requests)?
Anyway without knowing ruby I'm willing to try to get Instiki to install. What there depends on iconv
and how can I tell? From googles it looks like Nokogiri does. Anything else?
If I try something like ruby bundle install --path vendor/bundle
with the current Gemfile
and then as the next command type something like gem install nokogiri -- --use-system-libraries
(cf Nokogiri isn’t installing on Ruby 2.3) will that override things setup in the bundle install so that instiki --daemon
might succeed?
Did Instiki ever work under Windows ... ?
Yes. And, as far as I am aware, there are still quite a number of people running it under Windows.
In particular, ... will I run into all sorts of other problems... ?
I have no idea.
(cf Nokogiri isn’t installing on Ruby 2.3)
- That report has nothing to do with installing on Windows.
- According to the Bundler output you already posted, you encountered no problems installing Nokogiri.
So why are you asking about Nokogiri?
So why are you asking about Nokogiri?
A google turned up some stuff about Nokogiri and iconv problems. But mainly I was using it as an example for questioning how to patch a ruby install from the command line if that is at all possible.
Anyway, I got iconv
to install with
gem install iconv -v '1.0.4' -- --with-iconv-dir=C:/nLab/GnuWin32
from info at StackOverflow: Error while installing iconv on windows by ruby2.0.0. I downloaded libiconv-1.9.2-1.exe
by clicking Setup
on gnuwin32.sourceforge.net/packages/libiconv.htm. I then executed that and had it create C:/nLab/GnuWin32
.
Now, how do I tell the Instiki install to use this iconv
? Can I somehow pass the flag? Do I need to patch one of these?:
-
C:\nLab\instiki3.git\Gemfile
-
C:\nLab\instiki3.git\vendor\bundle\ruby\2.3.0\gems\iconv-1.0.4\Gemfile
A comment in that SO thread says:
You'll also want to make sure iconv's DLLs (found in the installation bin folder) are located in your PATH. If they're not, iconv.so won't load (LoadError).
So I tried
C:\nLab\instiki3.git>set PATH=%PATH%;C:\nLab\GnuWin32\bin
C:\nLab\instiki3.git>ruby bundle install --path vendor/bundle
but that didn't magically fix things.
ruby bundle config build.iconv --with-iconv-dir=...
ruby bundle install
progress somewhat, instiki now installs but instiki --daemon
fails.
I tried (for instiki3.git
the clone I had been working with and with a fresh clone instiki4.git
)
cd C:\nLab\instiki3.git ruby bundle config build.iconv --with-iconv-dir=C:/nLab/GnuWin32 ruby bundle install instiki --daemon
(do I need to do a gem install iconv -v '1.0.4' -- --with-iconv-dir=C:/nLab/GnuWin32
somewhere in the above sequence?)
for instiki3.git
I get the error message:
The specified module could not be found.
- C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv/iconv.so (LoadError)
for instiki4.git
I get the error message:
rescue in <top (required)>': Bundler couldn't find some gems.Did you run
bundle install`? (RuntimeError)
The instiki3.git
log:
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
C:\Users\Rod>cd C:\nLab\instiki3.git
C:\nLab\instiki3.git>ruby bundle config build.iconv --with-iconv-dir=C:/nLab/GnuWin32
C:\nLab\instiki3.git>ruby bundle install Fetching git://github.com/distler/maruku.git Fetching gem metadata from http://rubygems.org/........ Fetching version metadata from http://rubygems.org/.. Resolving dependencies... Using rake 10.4.2 Using RedCloth 4.3.2 Using abstract 1.0.0 Using daemons 1.2.3 Using erubis 2.7.0 Using eventmachine 1.2.0.1 Using file_signature 1.2.0 Installing iconv 1.0.4 with native extensions Using itextomml 1.5.2 Using json 1.8.3 Using nokogiri 1.5.11 Using syntax 1.1.0 Using rack 1.4.5 Using rails_xss 0.4.0 Using rubyzip 0.9.9 Using sqlite3 1.3.11 Using test-unit 2.5.5 Using bundler 1.11.2 Installing rdoc 4.2.2 Using maruku 0.7.3.beta1 from git://github.com/distler/maruku.git (at nokogiri@c67cc83) Installing thin 1.7.0 with native extensions Bundle complete! 19 Gemfile dependencies, 21 gems now installed. Bundled gems are installed into ./vendor/bundle. Post-install message from rdoc: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install
= 1.9.2 : nothing to do! Yay!
C:\nLab\instiki3.git>instiki --daemon
C:\nLab\instiki3.git>set PATH=.\lib\native\win32;C:\Ruby23\bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Ruby23\bin;C:\nLab\Ruby200\bin;C:\Program Files\Git\cmd
C:\nLab\instiki3.git>ruby.exe script\server -e production C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv.rb:1:in
require': 126: The specified module could not be found. - C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv/iconv.so (LoadError) from C:/nLab/instiki3.git/vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv.rb:1:in
<top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/inflector.rb:3:inrequire' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/inflector.rb:3:in
<top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:inrequire' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext/integer/inflections.rb:1:in
<top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb:2:inrequire' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext/integer.rb:2:in
<top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:inrequire' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in
block in <top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:ineach' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support/core_ext.rb:8:in
<top (required)>' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support.rb:56:inrequire' from C:/nLab/instiki3.git/vendor/rails/activesupport/lib/active_support.rb:56:in
<top (required)>' from script/server:7:inrequire' from script/server:7:in
' C:\nLab\instiki3.git>
The instiki4.git
log:
ruby 2.3.1p112 (2016-04-26 revision 54768) [i386-mingw32]
C:\Users\Rod>cd C:\nLab\instiki4.git
C:\nLab\instiki4.git>ruby bundle config build.iconv --with-iconv-dir=C:/nLab/GnuWin32
C:\nLab\instiki4.git>ruby bundle install Fetching git://github.com/distler/maruku.git Fetching gem metadata from http://rubygems.org/........ Fetching version metadata from http://rubygems.org/.. Resolving dependencies... Installing rake 10.4.2 Installing RedCloth 4.3.2 with native extensions Installing abstract 1.0.0 Installing daemons 1.2.3 Installing erubis 2.7.0 Installing eventmachine 1.2.0.1 Installing file_signature 1.2.0 Installing iconv 1.0.4 with native extensions Installing itextomml 1.5.2 with native extensions Using json 1.8.3 Installing nokogiri 1.5.11 Installing syntax 1.1.0 Installing rack 1.4.5 Installing rails_xss 0.4.0 Installing rubyzip 0.9.9 Installing sqlite3 1.3.11 Installing test-unit 2.5.5 Using bundler 1.11.2 Installing rdoc 4.2.2 Using maruku 0.7.3.beta1 from git://github.com/distler/maruku.git (at nokogiri@c67cc83) Installing thin 1.7.0 with native extensions Bundle complete! 19 Gemfile dependencies, 21 gems now installed. Use
bundle show [gemname]
to see where a bundled gem is installed. Post-install message from rdoc: Depending on your version of ruby, you may need to install ruby rdoc/ri data:<= 1.8.6 : unsupported = 1.8.7 : gem install rdoc-data; rdoc-data --install = 1.9.1 : gem install rdoc-data; rdoc-data --install
= 1.9.2 : nothing to do! Yay!
C:\nLab\instiki4.git>instiki --daemon
C:\nLab\instiki4.git>set PATH=.\lib\native\win32;C:\Ruby23\bin;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Windows Live\Shared;C:\Ruby23\bin;C:\nLab\Ruby200\bin;C:\Program Files\Git\cmd
C:\nLab\instiki4.git>ruby.exe script\server -e production C:/nLab/instiki4.git/config/preinitializer.rb:20:in
rescue in <top (required)>': Bundler couldn't find some gems.Did you run
bundle install? (RuntimeError) from C:/nLab/instiki4.git/config/preinitializer.rb:15:in
<top (required)>' from C:/nLab/instiki4.git/config/boot.rb:43:inload' from C:/nLab/instiki4.git/config/boot.rb:43:in
preinitialize' from C:/nLab/instiki4.git/config/boot.rb:25:inboot!' from C:/nLab/instiki4.git/config/boot.rb:139:in
<top (required)>' from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from C:/Ruby23/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in
require' from script/server:3:in `' C:\nLab\instiki4.git>
Sigh.
With a fresh install, you need to specify the path
ruby bundle config build.iconv --with-iconv-dir=...
ruby bundle install --path vendor/bundle
Subsequent invocation (with the same installation) should remember the path.
As to running instiki (now that it is ostensibly correctly installed), I would try
ruby instiki
which runs the server in the foreground (so you can see any error messages)
before going with
ruby instiki --daemon
which runs it in the background, with error messages sent to the logfile.
From the transcript you posted, it appears that iconv
has forgotten where you told it the shared library is located. You may need to copy
C:/nLab/GnuWin32/iconv.so
to
vendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv/iconv.so
even though that should have been unnecessary.
So ... Is there a resolution to this issue?
Something along the lines of
- Install the
libiconv package
following the instructions here. - Run
ruby bundle config build.iconv --with-iconv-dir=/path/to/dir/containing/libiconv.so
ruby bundle install --path vendor/bundle
- Copy
libinconv.so
tovendor/bundle/ruby/2.3.0/gems/iconv-1.0.4/lib/iconv/iconv.so
- Run
ruby instiki
Something else?
In the absence of further input, I'm gonna assume that did the trick.
Closing.
No. It didn't fix things. Can you re-open this.
I've got a lot of notes on things I've tried and maybe where the problem is but no definitive conclusion. I'll try to summarize them in another post within a few days. (I thought taking some time away would give new insights but it didn'
(does this need a new thread? It seems I had issues posting logs as this thread got longer)
OK. Reopening.
(does this need a new thread? It seems I had issues posting logs as this thread got longer)
It would be a lot less confusing to keep the whole discussion under one issue (unless it turns out that there are several distinct issues at play).
Things have progressed. The iconv
problem may be solved. But now when I type ruby instiki
I get the error:
C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:305:in 'qualified_const_defined?': "swig_runtime_data" is not a valid constant name! (NameError)
'ruby instiki' log:
C:\nLab\instiki5.git>ruby instiki
=> Booting Thin
=> Rails 2.3.18 application starting on http://0.0.0.0:2500
C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:305:in
'qualified_const_defined?': "swig_runtime_data" is not a valid constant name! (NameError)
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:618:in 'remove_constant'
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:575:in 'block in new_constants_in'
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:575:in 'each'
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:575:in 'ensure in new_constants_in'
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:576:in 'new_constants_in'
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:182:in 'require'
from C:/nLab/instiki5.git/config.ru:3:in 'block in <top (required)>'
from C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in 'instance_eval'
from C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in 'initialize'
from C:/nLab/instiki5.git/config.ru:1:in 'new'
from C:/nLab/instiki5.git/config.ru:1:in '<top (required)>'
from C:/nLab/instiki5.git/script/server:86:in 'eval'
from C:/nLab/instiki5.git/script/server:86:in '<top (required)>'
from instiki:6:in 'load'
from instiki:6:in '<main>'
The current script I'm using (with a fresh copy of instiki5.git
)
set PATH=%PATH%;C:\nLab\GnuWin32\bin
cd instiki5.git
ruby bundle config build.iconv --with-iconv-dir=C:/nLab/GnuWin32
ruby bundle install --path vendor/bundle
ruby instiki
The iconv
problem seems to have been that even though the bundle install
creates iconv.so
when Ruby tries to load it Ruby can't find the needed .dll
files and so somewhat bogously reports it can't find iconv.so
rather than it can't find a good version.
Sounds like a problem with the installation of the itextomml
gem. The only place swig_runtime_data
appears is in
`vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/ext/itex2MML_ruby.c`
(and in the shared library that gets compiled from that source). This was reported as Issue 24 (though the reporter did not mention that he was on Windows).
Apparently, the itextomml
gem is not the only one affected. It may be that I will have to issue a new version of the gem.
Could you try the following?
-
cd vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/ext/
- Apply the following patch
--- itex2MML_ruby.c.orig 2016-08-13 12:59:13.000000000 -0500
+++ itex2MML_ruby.c 2016-08-13 12:59:54.000000000 -0500
@@ -1722,7 +1722,7 @@
SWIG_Ruby_SetModule(swig_module_info *pointer)
{
/* register a new class */
- VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
+ VALUE cl = rb_define_class("Swig_runtime_data", rb_cObject);
/* create and store the structure pointer to a global variable */
swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
- Type
make
(this should recompile the shared C library). - Run Instiki as usual.
I patched itex2MML_ruby.c
changing a s
to S
.
By preceding make
with
set PATH=%PATH%;C:\nLab\rubyDevKit\bin;C:\nLab\rubyDevKit\mingw\bin;
it looks like it successfully compiles.
I'm going to have to postpone further testing till tomorrow morning.
The upper casing of that single s
did not fix things. I get the same error.
C:\nLab\instiki5.git>set PATH=%PATH%;C:\nLab\rubyDevKit\bin;C:\nLab\rubyDevKit\mingw\bin;
C:\nLab\instiki5.git>cd C:\nLab\instiki5.git\vendor\bundle\ruby\2.3.0\gems\itextomml-1.5.2\ext
C:\nLab\instiki5.git\vendor\bundle\ruby\2.3.0\gems\itextomml-1.5.2\ext>make
compiling itex2MML_ruby.c
linking shared-object itex2MML.so
C:\nLab\instiki5.git\vendor\bundle\ruby\2.3.0\gems\itextomml-1.5.2\ext>cd C:\nLab\instiki5.git
C:\nLab\instiki5.git>ruby instiki
=> Booting Thin
=> Rails 2.3.18 application starting on http://0.0.0.0:2500
C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:305:in 'qualified_const_defined?': "swig_runtime_data" is not a valid constant name! (NameError)
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:618:in 'remove_constant'
...
The upper casing of that single
s
did not fix things.
Obviously, it didn't, because the error message still complains about the lower-case s
.
I think you need to copy the new itex2MML.so
to vendor/bundle/ruby/2.3.0/extensions/
[arch]/2.3.0/itextomml-1.5.2/
I think you need to copy the new itex2MML.so to vendor/bundle/ruby/2.3.0/extensions/[arch]/2.3.0/itextomml-1.5.2/
I verified that the two files were different and then did
Rod@packard MINGW64 /c/nLab
$ cp C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/ext/itex2MML.so C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/itextomml-1.5.2/itex2MML.so
Rod@packard MINGW64 /c/nLab
$ ls -lat C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/itextomml-1.5.2/
total 176
-rwxr-xr-x 1 Rod 197121 169984 Aug 14 14:10 itex2MML.so*
drwxr-xr-x 1 Rod 197121 0 Aug 14 08:44 ../
drwxr-xr-x 1 Rod 197121 0 Aug 14 08:42 ./
-rw-r--r-- 1 Rod 197121 0 Aug 14 08:42 gem.build_complete
-rw-r--r-- 1 Rod 197121 3316 Aug 14 08:42 gem_make.out
ruby instiki
still gives the same error.
Sorry about this. I guess I need to know more about the packaging of gem extensions.
How about the copy of itex2MML.so
in vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/lib/
?
(N.B.: we're trying to verify that the "fix" works on Windows before I release a new version of the gem. With the new version, all this will be automatic.)
It got past the "swig_runtime_data" problem after I did:
cp C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/ext/itex2MML.so C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.2/lib/itex2MML.so
Now ruby instiki
gives cannot load such file -- sqlite3/sqlite3_native (MissingSourceFile)
more fully:
C:\nLab\instiki5.git>ruby instiki
=> Booting Thin
=> Rails 2.3.18 application starting on http://0.0.0.0:2500
C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in 'require': cannot load such file -- sqlite3/sqlite3_native (MissingSourceFile)
from C:/nLab/instiki5.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in 'require'
from C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11-x86-mingw32/lib/sqlite3.rb:6:in 'rescue in <top (required)>'
from C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.11-x86-mingw32/lib/sqlite3.rb:2:in '<top (required)>'
from C:/nLab/instiki5.git/vendor/plugins/bundler/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in 'require'
I'm a little confused. I thought the logs you posted earlier indicated that you has successfully installed the sqlite3
gem in your bundle. Evidently not...
There's a lot of discussion on the web about installing the sqlite3
gem under windows (see, e..g., here).
The solutions seem to vary from downgrading Ruby (from 2.3 to 2.0) to installing the sqlite3 shared libraries manually, before attempting to install the gem. Not sure which (if any) will work for you.
In any case, I think I am going to release a new version of the itextomml
gem, which (at least) will solve that issue.
itextomml 1.5.3 has been released.
I just tried ruby bundle install --path vendor/bundle
in a fresh copy of instiki5.git
(a robocopy
) and it blew up. I tried the same thing inf a fresh git clone
, instiki6.git
and got the same result. Changing instiki6.git/Gemfile
to contain
gem "itextomml", "1.5.2"
makes the bundle install
not blow up.
Log:
C:\nLab>robocopy instiki5Pure.git instiki5.git /MIR /nfl /ndl /log:C:\nLab\RoboLogs\I5G_ITMML_Log
Log File : C:\nLab\RoboLogs\I5G_ITMML_Log
C:\nLab>set PATH=%PATH%;C:\nLab\GnuWin32\bin
C:\nLab>cd C:\nLab\instiki5.git
C:\nLab\instiki5.git>ruby bundle config build.iconv --with-iconv-dir=C:/nLab/GnuWin32
C:\nLab\instiki5.git>ruby bundle install --path vendor/bundle
Fetching git://github.com/distler/maruku.git
Fetching gem metadata from http://rubygems.org/........
Fetching version metadata from http://rubygems.org/..
Resolving dependencies...
Installing rake 10.4.2
Installing RedCloth 4.3.2 with native extensions
Installing abstract 1.0.0
Installing daemons 1.2.4
Installing erubis 2.7.0
Installing eventmachine 1.2.0.1
Installing file_signature 1.2.0
Installing iconv 1.0.4 with native extensions
Installing itextomml 1.5.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.3/ext
C:/Ruby23/bin/ruby.exe -r ./siteconf20160815-8684-p553fd.rb extconf.rb
creating Makefile
current directory: C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.3/ext
make "DESTDIR=" clean
current directory: C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.3/ext
make "DESTDIR="
generating itex2MML-i386-mingw32.def
compiling itex2MML_ruby.c
compiling lex.yy.c
itex2MML.l: In function 'itex2MML_yylex':
itex2MML.l:401:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
itex2MML.l: At top level:
itex2MML.l:1106:6: error: conflicting types for 'itex2MML_setup'
In file included from itex2MML.l:15:0:
itex2MML.h:42:17: note: previous declaration of 'itex2MML_setup' was here
lex.yy.c:5864:16: warning: 'input' defined but not used [-Wunused-function]
make: *** [lex.yy.o] Error 1
make failed, exit code 2
Gem files will remain installed in C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/gems/itextomml-1.5.3 for inspection.
Results logged to C:/nLab/instiki5.git/vendor/bundle/ruby/2.3.0/extensions/x86-mingw32/2.3.0/itextomml-1.5.3/gem_make.out
Using json 1.8.3
Installing nokogiri 1.5.11
Installing syntax 1.1.0
Installing rack 1.4.5
Installing rails_xss 0.4.0
Installing rubyzip 0.9.9
Installing sqlite3 1.3.11
Installing test-unit 2.5.5
Using bundler 1.11.2
An error occurred while installing itextomml (1.5.3), and Bundler cannot
continue.
Make sure that 'gem install itextomml -v '1.5.3'' succeeds before bundling.
C:\nLab\instiki5.git>
Crap!
I missed a couple of pointer-type conversions which make compilation fail on 32bit systems. Very unhappy to say that I had to release itextomml 1.5.4
to fix that.
ruby bundle install --path vendor/bundle
now works for me, and ruby instiki
gets to the previous point where it complains about sqlite3
.
Well, that's better.
One of the suggestions vis-a-vis sqlite3
on Windows was to downgrade Ruby to 2.0.
I may have gotten past the sqlite3
problem but now I have a Couldn't load 2.3/redcloth_scan
problem, which I'm currently looking into. Does that ring a bell?
One of the suggestions vis-a-vis sqlite3 on Windows was to downgrade Ruby to 2.0.
I tried downgrading to both Ruby22
and Ruby200
but that brings back the iconv
problem. I used the same script that gets past it inRuby23
.
The sqlite3
issue is maybe sort of fixed, Github: sparklemotion/sqlite3-ruby/pull/186 (Update rake-compiler-dock to support RubyInstaller-2.3.0), but that hasn't yet made it to the sqlite3 gem. I tried to use that gem from Github
gem "sqlite3", :branch => 'master', :git => 'git://github.com/sparklemotion/sqlite3-ruby.git'
but that didn't work. Ruby couldn't find the gem 'sqlite3 x86-mingw32' there.
Following instructions from Github: sparklemotion/sqlite3-ruby/issues/185 (LoadError on Windows x64, Ruby 2.3) I downloaded sqlite3 sources, did a configure
and make
, and then
gem install sqlite3 --platform=ruby -- --with-sqlite3-include=/c/nLab/sqliteTMP/usr/local/include --with-sqlite3-lib=/c/nLab/sqliteTMP/usr/local/lib
Then I patched instiki23.git/Gemfile
, changing the line:
gem "sqlite3", :require => "sqlite3"
to
gem "sqlite3", "1.3.11", :path => "/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11"
(that was the only way I found to get instiki
to use that gem)
Partial log:
C:\nLab\instiki23.git>ruby bundle install --path vendor/bundle
...
Using sqlite3 1.3.11 from source at `C:/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11`
...
C:\nLab\instiki23.git>ruby instiki
=> Booting Thin
=> Rails 2.3.18 application starting on http://0.0.0.0:2500
C:/nLab/instiki23.git/vendor/rails/activesupport/lib/active_support/dependencies.rb:184:in `require': cannot load such file -- 2.3/redcloth_scan (MissingSourceFile)
Couldn't load 2.3/redcloth_scan
The $LOAD_PATH was:
...
Wow, this is getting ridiculous.
Again, it seems that ruby bundle install
is failing to (properly) install some gem
and that failure is not being detected until you try to run the program.
Anyway, this time, the gem
is a more-or-less superfluous one: redcloth
supports the optional Textile
markup dialect which you probably don't intend to use. (Textile used to be the default markup, and it's still there to support legacy installations.)
Since you're never going to use it, just delete that line from the Gemfile
and apply the following patch
--- lib/chunks/engines.rb.orig 2016-08-25 16:42:54.000000000 -0500
+++ lib/chunks/engines.rb 2016-08-25 16:46:26.000000000 -0500
@@ -5,7 +5,6 @@
require 'maruku'
require 'maruku/ext/math'
require_dependency 'rdocsupport'
-require 'redcloth'
require 'oldredcloth'
# The markup engines are Chunks that call the one of RedCloth
@@ -32,7 +31,7 @@
class Textile < AbstractEngine
def mask
@content.as_utf8
- redcloth = RedCloth.new(@content, [:hard_breaks] + @content.options[:engine_opts])
+ redcloth = OldRedCloth.new(@content, [:hard_breaks] + @content.options[:engine_opts])
redcloth.filter_html = false
redcloth.no_span_caps = false
html = redcloth.to_html(:textile)
I'd like (at some point) to understand why ruby bundle install
is failing so spectacularly in your setup. But the first order of business is to get Instiki
running for you.
While I'm thinking about it why do my installs use bundler 1.11.2
rather than the most recent gem bundler 1.12.5
? Does this make a difference?
The last lines of instiki23.git/Gemfile.lock
are
BUNDLED WITH
1.11.2
I can't figure out where this preference is set or if it is derived some way.