<joshAnderson99>
hi, am trying to install iconv on windows ruby with "gem install iconv", but the compile mentions missing libraries/headers. have downloaded libiconv-1.14 which contains these possibly, but not sure how to provide configuration options so it can be found. there's -with and --without in the options format apparently, but so far haven't found a web page that mentions why there's a "without"
<joshAnderson99>
(with makes sense).
zachrab has joined #rubygems
<joshAnderson99>
from web page: "download iconv-1.9.2.win32.zip, extract it and copy bin/iconv.dll to ruby/bin", but that might be for compilation rather than supporting require. unless dlls in ruby can work the same way as .pyd files in python which do support the equivalent of require, as "import".
<joshAnderson99>
just tried: gem install iconv --with-iconv-lib=C:/libiconv-1.14/lib --with-iconv-include=C:/libiconv-1.14/include
<joshAnderson99>
but error msg: ERROR: While executing gem ... (OptionParser::InvalidOption)
<imperator>
hm, i thought iconv wasn't really necessary any more.
<imperator>
joshAnderson99, your iconv stuff is in c:/libiconv-1.1.4, right?
<imperator>
unless this is a dependency for something else, i think ruby's builtin string encoding should be able to do what you want
zachrab has quit [Ping timeout: 240 seconds]
<joshAnderson99>
hello again, glad someone's around. it isn't apparently, but want to run a script that someone's written that requires that lib. obviously could modify the code, and might as a last resort to use string, but i figure this might not be the only lib around that uses deprecated libs, and it would be good to know who to deal with them.
<joshAnderson99>
iconv stuff for all intents and purposes is there yes. actually its on the desktop, but brevity in msg here, shorted to root.
<joshAnderson99>
*the only code around that uses deprecated libs
<joshAnderson99>
would seem maybe to just be a matter of letting gem know where to find includes when it's building the lib. not sure how to do that though.
<joshAnderson99>
the ruby file i'm trying to run, and as might have noticed, the 2 require's have so far tolled about a day. so quite eager to install the libs successfully.
<joshAnderson99>
why's that? not more problems i hope. strange format i know.
<imperator>
OLD format
<imperator>
precursor to xml
<joshAnderson99>
well, people in media may not always exactly be trend setters in technology. thankfully i wasn't the one working there having to implement the thing using sgml, and at the same timing managing an authentic smile at the manager.
<joshAnderson99>
checking for rb_enc_get() in ruby/encoding.h... yes
<joshAnderson99>
checking for iconv() in -liconv... no
<joshAnderson99>
*** extconf.rb failed ***
<joshAnderson99>
checking for iconv() in iconv.h... no
<joshAnderson99>
Could not create Makefile due to some reason, probably lack of necessary
<joshAnderson99>
libraries and/or headers. Check the mkmf.log file for more details. You may
<joshAnderson99>
need configuration options.
<imperator>
is there an iconv.h file in c:/libiconv-1.1.4/include?
<joshAnderson99>
gee, that's a very relevant question it turns out. there isn't. what sort of lib dist is that.
<joshAnderson99>
has iconv.h.in, iconv.h.build.in, and export.h
<imperator>
yeah, i remember this library being a pain in the ass
<imperator>
i thought luis bundled it, but i guess not any more
<joshAnderson99>
luis?
<joshAnderson99>
author of the lib i guess
<imperator>
luis, the guy who makes the windows installer for ruby
<joshAnderson99>
ok, very new to ruby, so forgive my unfamiliarity with things in rubydom as they call it, or would have undoubtedly.
<joshAnderson99>
probably short of time, or raising the entry requirements into ruby.
<joshAnderson99>
should be a iconv.h file about.. maybe just stick that in the /include dir.
<joshAnderson99>
but if the .h file is missing, one wonders if there might be other stuff as well
<imperator>
i think you have to build it
<imperator>
do you have mingw installed?
<joshAnderson99>
yeah
<joshAnderson99>
that's what the mod versions of .h are for. presumably then from which it might generate the proper .h
<imperator>
ok, fire up a mingw/bash shell
<imperator>
yeah, do the configure/make bit
<joshAnderson99>
ur over europe way i guess?
<imperator>
us
<imperator>
up late
<joshAnderson99>
with a bit of luck i shant be responsible for making that much later.
<joshAnderson99>
mostly windows app dev, not this low lever compiler stuff, except at uni of course. although get my hands dirty with that sort of thing occasionally as the need arises. a mingw shell. that's just dos right?
<imperator>
no
<joshAnderson99>
ok.. there's probably a .exe that runs a shell
<imperator>
it's a bash shell emulator
<joshAnderson99>
something like that in vb i think
<joshAnderson99>
ok
<joshAnderson99>
does the shell have a name? some exe file?
<imperator>
if you don't have mingw installed, you don't have it
<joshAnderson99>
it's installed
<joshAnderson99>
but.. where's the shell executable?
<joshAnderson99>
but it's just a folder in C, included in path so compile exe's can be invoked as far as i know.
<joshAnderson99>
maybe the windows version doesn't include a shell
<joshAnderson99>
or that option wasn't installed
<joshAnderson99>
stackoverflow page: "I can't find my MingW shell after installing with GUI installer"
<imperator>
man, this thing used to be simpler, now it's a package manager
<joshAnderson99>
mingw?
<imperator>
yeah
<joshAnderson99>
i might have to reinstall it, with shell option included.
<imperator>
you shouldn't have to, if it's just a package
<imperator>
try to find....one sec
<joshAnderson99>
is it necessary to use the shell? rather than a command
<imperator>
guimain maybe, under mingw/libexec
<imperator>
actually, let's see if you have the shell
<imperator>
fire up a regular windows shell, cd to c:\mingw\bin and type "bash"
<joshAnderson99>
btw, just ran gui.exe in C:\MinGW\libexec\mingw-get>... and window popped up saying..
<joshAnderson99>
"the gui for mingw-get is not yet available. use command line version"
<joshAnderson99>
there is no bash apparently. maybe my mingw is out of date.
<joshAnderson99>
C:\MinGW\bin>bash
<joshAnderson99>
'bash' is not recognized as an internal or external command,
<joshAnderson99>
operable program or batch file.
<joshAnderson99>
that's why they call it minimalist i guess
<joshAnderson99>
minimalist gnu
<joshAnderson99>
from the site: "MSYS, a contraction of "Minimal SYStem", is a Bourne Shell command line interpreter system. Offered as an alternative to Microsoft's cmd.exe"
<imperator>
yep, get that
<joshAnderson99>
so it's around, but just not local.
<joshAnderson99>
ok.. might be easier to reinstall. it's a fast connection.
<imperator>
ok, reinstall then
<imperator>
yeah, looks like they ditched the single installer because it was too difficult to update individual components
<joshAnderson99>
setup program crashed perhaps because uninstall mingw while it was open.. so restarting.
<joshAnderson99>
this minimalist theme is extensive. on clicking continue the setup window just disappeared. not sure if it's downloading. if not will try it again.
<joshAnderson99>
maybe it finished
<joshAnderson99>
setup window working now...
<joshAnderson99>
just the basic setup presumably
<joshAnderson99>
with msys
<joshAnderson99>
it's downloading the packages
<imperator>
ok
<joshAnderson99>
i hope this doesn't take too long, given it's late there, and to have iconv working would be sensational. to have that script running at last.
<joshAnderson99>
broadband connection with the monopoly provider in oz, so download speed is better than anything else other than fiber.
<imperator>
the weird thing is that there's a libiconv-2.dll file in the ruby/bin directory
<joshAnderson99>
you'd think that might do it, but maybe it's there just for compilation purposes, rather than for provision of a library accessible through 'require'
<joshAnderson99>
seems it's finished installing
<imperator>
shit, didn't work for me when i ran make
<joshAnderson99>
ah no!
<joshAnderson99>
imperative that it does
<joshAnderson99>
at the bash shell if that's of any use.
<joshAnderson99>
bash-3.1$
<imperator>
you can try it, see if it works
<imperator>
cd to your libiconf directory, run ./configure then make
<joshAnderson99>
ok.. cmds?
<imperator>
might want to double check the readme
<imperator>
i'm actually very curious why it doesn't just work out of the box for ruby 2
<joshAnderson99>
bash seems to have taken out the cmd popup menu, which was useful for pasting. curious.
<imperator>
i don't think i ever had to build this for mingw before, just for vs
<joshAnderson99>
you wouldn't know how to do a paste in bash would u?
<joshAnderson99>
it's ok.. the window menu works
stepheneb__ has joined #rubygems
<joshAnderson99>
it didn't like that...
<joshAnderson99>
C:\MinGW\msys\1.0\bin>bash
<joshAnderson99>
bash-3.1$ cd C:\libiconv-1.14
<joshAnderson99>
bash-3.1$ ./configure
<joshAnderson99>
./configure: line 441: expr: command not found
<joshAnderson99>
./configure: line 442: sed: command not found
<joshAnderson99>
./configure: line 442: sed: command not found
<joshAnderson99>
./configure: line 456: sed: command not found
<joshAnderson99>
: error: cannot create .lineno; rerun with a POSIX shell
stepheneb__ has quit [Client Quit]
<imperator>
yeah, this is a pain, shouldn't have to be doing this
<joshAnderson99>
ur not kidding. although i can imagine i would be moreso without a guru around.
<joshAnderson99>
*it
<joshAnderson99>
it's a lot of messing around for character conversion.
<imperator>
a workaround, if it's a viable option, is to install the 1.9.3 installer for windows
<imperator>
and use that; it has iconv baked in
<joshAnderson99>
which includes iconv presumably
<imperator>
you may get a deprecation warning, but it'll work
<joshAnderson99>
ok.. that's a good option to have. otherwise, perhaps might just use the string version. though not a ruby coder, at least not a practiced one, i imagine changing 1 line in that script wouldn't be too problematic.
<joshAnderson99>
any adv you know of in using 2 instead?
<joshAnderson99>
it wouldn't seem like a big jump, but hard to tell.
<joshAnderson99>
for later rails stuff the newer version might have some advantages.
<joshAnderson99>
might try string option first then at least. and with a bit of luck finding the right string command will prove to be less an adventure than iconv.
adambeynon has joined #rubygems
<imperator>
ruby 2 is mostly implementation improvements behind the scenes, but there are some other differences
<imperator>
generally i would encourage you to use 2.x
<joshAnderson99>
thanks for your help anyway. it's wonderful when jumping into a not as yet fully evolved language like ruby, to have someone like you around. although i have a bunch of books on ruby, so these situations shouldnt' be arising to frequently. i should let you take advantage of the night while it lasts.
<imperator>
yw
<imperator>
oh, does that program only refer to iconv once?
* imperator
looks again
<imperator>
well, fuck
<joshAnderson99>
it does, only once. i was staring into the face of a presumed can of worms with the compilation/gem issue with iconv, so looked at that specifically to check how easy it would be to switch to string.
<imperator>
line.encode('UTF8')
<imperator>
er, line.encode!('UTF8')
<imperator>
oops, UTF-8
<joshAnderson99>
the result of a lovely language, or improve in that respect at least, and some very well timed advice.
<imperator>
try that, see if it works
<joshAnderson99>
must moving the reuters folder into the right place...
<joshAnderson99>
ok.. the joys of change. it appears maybe the ruby file is assuming a format that actually differs somewhat from the reuters dist that includes the sgml files. not sure why. but that i will have to look into. the line you've got looks like it would do the job, and if not, would be very close. so i should probably get on with it from here. and let you go. very helpful again you've been.
<joshAnderson99>
handy to know of the bash shell in mingw too should other windows install issues arise.
<imperator>
generally speaking you shouldn't have to mess around with that
<imperator>
that ended up being a waste of time anyway
<imperator>
most gems come with precompiled binaries, and that library in particular is part of the stdlib, so it should "just work"
<joshAnderson99>
exploring spaces that ultimately turn out not hold the treasure sought if it could be put that way, very imaginatively, isn't necesarily altogether a waste. it might come in useful for some other compilation task.
<imperator>
:)
<joshAnderson99>
and the time it's saved me.. i'd have been here till midnight having to comb through all the relevant bits of ruby and mingw trying tog et that to work.
<imperator>
for encoding issues and whatnot, i suggest moving over to #ruby-lang
<joshAnderson99>
ok, although i've dealt with those in python, so though rookie class in ruby as yet, i wouldn't imagine that a cursory look at materials wouldn't resolve any issues were they to arise.
<joshAnderson99>
a switch to unix is also a possibility later on.. but initially prefer to stay in windows. assuming compatibility issues dont end up driving me mad.
<joshAnderson99>
let you get on with what's left of your evening. thanks.
<imperator>
np
workmad3 has joined #rubygems
<imperator>
oh, just realized you can do line.encode(to, from), so maybe line.encode!("UTF-8", "CP1251")
<imperator>
anyhoo, i think i'm done for the night
<joshAnderson99>
ok, that could be a gem ;)
<imperator>
and hop into #ruby-lang for general questions
<imperator>
good luck, cya
imperator has quit [Quit: Leaving]
Elhu has joined #rubygems
TheMoonMaster has quit [Remote host closed the connection]
mattwynne has joined #rubygems
mattwynne has quit [Remote host closed the connection]
mattwynne has joined #rubygems
mattwynne has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
tekin has joined #rubygems
tekin has quit [Client Quit]
Elhu has quit [Quit: Computer has gone to sleep.]
Elhu has joined #rubygems
Elhu has quit [Client Quit]
<joshAnderson99>
sorry folks, but another gem issue encountered with ruby-debug. have tried various gem debug install commands, (gem install ruby-debug --platform=mswin32