compile error for parse-members.rb

63 views
Skip to first unread message

wwwalker

unread,
Jan 7, 2012, 2:14:14 PM1/7/12
to OpenAustralia Community
Following, http://software.openaustralia.org/install-parser.html, I am
trying to install openaustralia-parser on Windows 7, XAMPP,
Rubyinstaller, rmagick-win32.

I get this obscure bug when I run parse-members.rb. Any help is
welcome. I have spent hours on this.

See:

C:\xampp\htdocs\oa\openaustralia-parser>.\parse-members.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in
`to_specs': Co
uld not find mechanize (= 0.9.2) amongst [activesupport-3.1.3,
bigdecimal-1.1.0,
builder-3.0.0, diff-lcs-1.1.3, domain_name-0.5.1, htmlentities-4.3.1,
io-consol
e-0.3, json-1.6.4, json-1.5.4, log4r-1.1.10, mechanize-2.1,
minitest-2.10.0, min
itest-2.5.1, multi_json-1.0.4, net-http-digest_auth-1.2, net-http-
persistent-2.3
.3, nokogiri-1.5.0-x86-mingw32, ntlm-http-0.1.1, rake-0.9.2.2,
rcov-0.9.11, rdis
count-1.6.8, rdoc-3.12, rdoc-3.9.4, rmagick-2.12.0-x86-mswin32,
rspec-2.8.0, rsp
ec-core-2.8.0, rspec-expectations-2.8.0, rspec-mocks-2.8.0, rubygems-
update-1.8.
15, unf-0.0.4, unf_ext-0.0.4-x86-mingw32, webrobots-0.0.12]
(Gem::LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
dependency.rb:256:in `
to_spec'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:1208:in
`gem'
from C:/xampp/htdocs/oa/openaustralia-parser/lib/
environment.rb:6:in `<t
op (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/xampp/htdocs/oa/openaustralia-parser/lib/name.rb:1:in
`<top (req
uired)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/xampp/htdocs/oa/openaustralia-parser/lib/
people_csv_reader.rb:8:
in `<top (required)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/xampp/htdocs/oa/openaustralia-parser/lib/people.rb:
1:in `<top (r
equired)>'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/
custom_require.rb:36:i
n `require'
from C:/xampp/htdocs/oa/openaustralia-parser/parse-members.rb:
6:in `<mai
n>'

Henare Degan

unread,
Jan 8, 2012, 2:57:26 AM1/8/12
to openaust...@googlegroups.com

It's saying you don't have mechanize version 0.9.2 installed.

I think we have a Gemfile now so try to run 'bundle' or just manually install that version of mechanize.

Cheers,

Henare

--
You received this message because you are subscribed to the Google Groups "OpenAustralia Community" group.
To post to this group, send email to openaust...@googlegroups.com.
To unsubscribe from this group, send email to openaustralia-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openaustralia-dev?hl=en.

wwwalker

unread,
Jan 13, 2012, 9:38:28 AM1/13/12
to OpenAustralia Community
I installed bundler then ran bundle install.

Error on hpricot install:

C:\Users\Dwight\openaustralia>gem install hpricot -v '0.6.164'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.

c:/ruby193/bin/ruby.exe extconf.rb
checking for stdio.h... yes
creating Makefile

make
generating fast_xs-i386-mingw32.def
compiling fast_xs.c
fast_xs.c: In function 'fast_xs':
fast_xs.c:169:13: error: 'struct RArray' has no member named 'ptr'
fast_xs.c:170:16: error: 'struct RArray' has no member named 'len'
fast_xs.c:175:13: error: 'struct RArray' has no member named 'ptr'
fast_xs.c:176:16: error: 'struct RArray' has no member named 'len'
make: *** [fast_xs.o] Error 1

Gem files will remain installed in c:/ruby193/lib/ruby/gems/1.9.1/gems/
hpricot-0.6.164 for inspection.
Results logged to c:/ruby193/lib/ruby/gems/1.9.1/gems/hpricot-0.6.164/
ext/fast_xs/gem_make.out

Dwight Walker

On Jan 8, 6:57 pm, Henare Degan <henare.de...@gmail.com> wrote:
> It's saying you don't have mechanize version 0.9.2 installed.
>
> I think we have a Gemfile now so try to run 'bundle' or just manually
> install that version of mechanize.
>
> Cheers,
>
> Henare
> On Jan 8, 2012 5:13 PM, "wwwalker" <dwi...@wwwalker.com.au> wrote:
>
>
>
>
>
>
>
> > Following,http://software.openaustralia.org/install-parser.html, I am

Henare Degan

unread,
Jan 13, 2012, 7:53:37 PM1/13/12
to openaust...@googlegroups.com
On Sat, Jan 14, 2012 at 00:08, wwwalker <dwi...@wwwalker.com.au> wrote:
I installed bundler then ran bundle install.

Error on hpricot install:

The Google suggested this page: http://stackoverflow.com/questions/1718500/installing-hpricot-on-ruby-1-9-1-on-windows

It suggests running `gem install hpricot -v '0.6.164' --platform=mswin32`

That might work but I've got no idea since I've never run it on Windows - you might want to upgrade your operating system ;)

In all seriousness though, once you do get it running it'd be great if you could write up how you did it as we've never had someone run it on Windows as far as I know.

Cheers,

Henare

wwwalker

unread,
Jan 24, 2012, 11:58:54 AM1/24/12
to OpenAustralia Community
I installed Ruby 1.8.7 and hpricot 0.6.164 compiled.

On Jan 14, 11:53 am, Henare Degan <hen...@openaustralia.org> wrote:
> On Sat, Jan 14, 2012 at 00:08, wwwalker <dwi...@wwwalker.com.au> wrote:
> > I installed bundler then ran bundle install.
>
> > Error on hpricot install:
>
> The Google suggested this page:http://stackoverflow.com/questions/1718500/installing-hpricot-on-ruby...

wwwalker

unread,
Jan 24, 2012, 12:02:38 PM1/24/12
to OpenAustralia Community
I edited install-parse.textile but could not get git to commit it.

Here is the text til I work out how to get the content into github via
wacky old git.

h3. For Windows

Ruby has its own Windows versions that you need to get from
"RubyInstaller for Windows":http://rubyinstaller.org/downloads (choose
the one-click installer option).

Download and install Ruby 1.8.7-p357 (compatible with hpricot 0.6.164)
Download and install DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe
Download and install ftp://ftp.imagemagick.org/pub/ImageMagick/binaries/ImageMagick-6.7.4-8-Q16-windows-dll.exe
Download and install RMagick from https://github.com/rmagick/rmagick/zipball/master
and extract it into "C:\Ruby187\lib\ruby\gems\1.8\gems\rmagick-rmagick
\" folder.
gem install rmagick
gem install bundler
bundle

In addition to the Ruby gems required above you'll need to install
Ruby-MySQL, which can be downloaded from "http://www.tmtm.org/en/ruby/
mysql/":http://www.tmtm.org/en/ruby/mysql/.

There is an error connecting to MySQL 5.0+ with Ruby due to change in
password hash length so you will have to recompile with the include
path set to the new MySQL C library

h2. Configure the Parser

The only configuration necessary is to change the web-root if you have
installed the web application in another location. That value is
<code>web_root</code> in <code>openaustralia/openaustralia-parser/
configuration.yml</code>:
web_root: "c:\xampp\htdocs\oa"

Copy https://github.com/mysociety/theyworkforyou/blob/master/conf/general-example
to c:\xampp\htdocs\oa\twfy\conf\general.

Edit the define to have:

define ("DB_HOST", "localhost");
define ("DB_USER", "root");
define ("DB_PASSWORD", "");
define ("DB_NAME", "openaustralia");
define ("FILEIMAGEPATH", "c:\xampp\htdocs\oa\openaustralia-parser
\pwdata\images");
define ("PWMEMBERS", "c:\xampp\htdocs\oa\openaustralia-parser\data");
define ("RAWDATA", "c:\xampp\htdocs\oa\openaustralia-parser\data");
define ("REGMEMPDFPATH", "c:\xampp\htdocs\oa\openaustralia-parser
\data");
define ("BASEDIR", "c:\xampp\htdocs\oa");

Download and install XAMPP from http://www.apachefriends.org/en/xampp.html.

This includes MySQL, Apache and PHP.

h2. Run the Parser

In Windows, copy:

https://github.com/openaustralia/rblib/blob/master/config.rb

to

c:\xampp\htdocs\oa\rblib\config.rb

Edit config.rb to have c:\xampp\php\php.exe as PHP executable
(currently only for UNIX).


On Jan 14, 11:53 am, Henare Degan <hen...@openaustralia.org> wrote:
> On Sat, Jan 14, 2012 at 00:08, wwwalker <dwi...@wwwalker.com.au> wrote:
> > I installed bundler then ran bundle install.
>
> > Error on hpricot install:
>
> The Google suggested this page:http://stackoverflow.com/questions/1718500/installing-hpricot-on-ruby...

Henare Degan

unread,
Jan 24, 2012, 5:56:24 PM1/24/12
to openaust...@googlegroups.com
Hi Dwight,

I found your commit on Github just fine and I've merged it into the doco.

I think one of the problems you were having is the instructions assumed you had the web application set up - I've included this in the instructions now! :) Thanks for contributing back to the Windows documentation.

Cheers,

Henare

Reply all
Reply to author
Forward
0 new messages