Same problem here. I'm developing on windows, but need Nokogiri for
Mephisto (rails blog platform).

I'm going to post another thread or send a support request, because
Nokogiri needs it's native extensions built for the target platform
it's installed on. I tried doing that with the non-windows version of
nokogiri on Heroku with "gems:build" in the Rake console, but got
errors like "need libxslt", which is a C library and would need to be
addressed by Heroku staff. (In other words, it's not a user-hackable
issue, unfortunately.)

To answer your question: "any suggestions on how do I find the *nix
version of the gem, and
upload and install it on Heroku?"... I'll explain below:

Steps to upload and install standard, non-windows nokogiri gem from
Windows to Heroku:

1. Download the non-windows version of the Nokogiri gem file here:
http://rubyforge.org/frs/?group_id=7062&release_id=30406
(It's the third one down called "nokogiri-1.1.1.gem")

2. Once you have nokogiri-1.1.1.gem downloaded, open a standard
windows command prompt in that folder and type: "gem unpack
nokogiri-1.1.1.gem". This will create a folder named
"\nokogiri-1.1.1\" containing the contents of the nokogiri gem.

3. Move the newly created nokogiri gem folder to your local rails app:
"\appname\vendor\gems\nokogiri-1.1.1"

4. Create a gzipped Tarball of your local rails app with "tar -cf
appname.tar", then "gzip appname.tar" which creates: "appname.tar.gz".
(You'll need Cygwin or some other open-source tools to create tar
archives and use gzip in Windows.)

5. Upload/Import your local zipped archive file "appname.tar.gz" into
your Heroku app... (or create a new app if you are worried about
existing files and you want to test it first, then migrate your old
data to the new app once the bugs are worked out.)

6. Then open your Rake console and run: "gems:refresh_specs". If you
get the error "gem has no specification file" you will need to create
one on your windows machine called ".specification" and upload it to "/
vendor/gems/nokogiri-1.1.1/", then re-run the command.

To create the ".specification" for the gem, open the windows command
prompt again in the folder where you downloaded the nokogiri-1.1.1.gem
file earlier and run: "gem spec nokogiri-1.1.1.gem".

This will output the spec file contents to the console. Just copy the
spec output from the console and put it into a file called
".specification", then in the Heroku "Edit" area, go to your /vendor/
gems/nokogiri-1.1.1/ folder and select "Upload" and choose
the .specification file that you just created from the nokogiri gem to
upload it.

(Note: files prefixed with a period are not displayed in Heroku's file
explorer panel. So you won't see the ".specification" file listed
there once you've uploaded it. They *are* being uploaded, though.)

Then re-run gems:refresh_specs. That should fix it.

Note: If it balks at the .specification file again, check to make sure
you copied the specs correctly and didn't accidentally include, say,
Dos prompt stuff from the console where you generated the spec. The
spec file should start with "--- !ruby/object:Gem::Specification" and
end with "test_files: []"... Not that *I* would ever do that...
Nooooooo. Of course, not. :)

7. The next step is to build the native extensions on Heroku with
"rake gems:build", which would finalize the nokogiri installation, but
as I mentioned before the libxslt C library doesn't seem to be
available on Heroku. So I guess I will need to contact them to see if
it's even possible to use nokogiri on their servers.

I'll post an update when I have more info. Hope that helps.

-Steve


On Jan 21, 6:45 am, dong <[email protected]> wrote:
> I did not try hpricot, as people seems to be moving over tonokogiri.
> hpricot's development seems to be stalled.
>
> nokogiriclaim better performance, it also has better support for
> xpath and css selectors. it does have some c code, that is why I can't
> just upload my local windows copy into heroku.
>
> has anybody gotnokogiriwork on Heroku?
>
> thanks
> Dong
>
> On Jan 20, 9:26 pm, Keenan Brock <[email protected]> wrote:
>
> > Hi,
>
> > I read thatnokogiriis a drop in replacement for hpricot. Not sure  
> > exactly how close the APIs are.
>
> > Have you tried your app with hpricot? It is at least a pure ruby  
> > implementation. Making it easier to deploy to a server where you can  
> > not compile c gems.
>
> > Not sure if hpricot has acceptable performance or if it meets your  
> > needs, but thought it may be worth a shot.
>
> > --Keenan
>
> > On Jan 20, 2009, at 10:10 PM, dong wrote:
>
> > > I have just deployed my first Heroku application. It needs the
> > >nokogirigem. It is not available on Heroku. I develop on Windows
> > > locally, so I can not upload my local copy of the gem.
>
> > > can this gem be made available on Heroku?
> > > or any suggestions on how do I find the *nix version of the gem, and
> > > upload and install it on Heroku?
>
> > > thanks
> > > Dong
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to