views:

531

answers:

4

I have the following gems defined in my environment.rb file:

  config.gem "authlogic"
  config.gem "paperclip"
  config.gem "pauldix-feedzirra", :lib => "feedzirra", :source => "http://gems.github.com"
  config.gem 'whenever', :lib => false, :source => 'http://gemcutter.org/'

I have them installed on my local computer and everything is working well. Since I am working on a shared-server (DreamHost), I need to unpack those gems to get them to work (can't install them as I did on my own computer to get them to work).

Before uploading, I ran the following on my local machine:

rake gems:unpack

This created the following folders in /vender/gems:

authlogic-2.1.3, paperclip-2.3.1.1, pauldix-feedzirra-0.0.18, whenever-0.4.1

So it looks like they're all there.

When I run rake db:migrate on the server, though, I get these following error:

Missing these required gems:
  pauldix-feedzirra

For some reason, the feedzirra unpacked gem is not detected. Could anybody offer a clue as to why this is happening and a potential solution?

Thanks!


EDIT: Thanks, but the code to put in environment.rb doesn't work, and bundler won't install properly on my server. Any other suggestions?

A: 

Try Following.put this code in envoirment.rb

  config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir| 
    File.directory?(lib = "#{dir}/lib") ? lib : dir
  end
Salil
Thanks, but this doesn't seem to work...
yuval
+1  A: 

This isn't exactly an answer, but since I could never get config.gem to work properly, I recommend using Bundler whenever I can. It just works and it handles interdependencies between gems well. It also replaces config.gem in Rails 3 from what I understand.

Alex - Aotea Studios
A: 

Don't know if my hints are useful, because feedzirra is compiled extension (against CURL i think). Better solution is to normally install feedzirra gem (it will compile itself) on your server.


You have not installed (unpacked) feedzirra gem, but pauldix-feedzirra. Probably you need feedzirra unpacked too.

Try to add

config.gem feedzirra

into environment.rb and run locally

rake gems:install
rake gems:unpack

It looks like feedzirra unpacked gem is missing in /vendor/plugins. Look if feedzirra will be copied there after those commands...

retro
+1  A: 

I notice two things about feedzirra: first, it depends on 3 other gems, and at least one of those build native extensions. And I'm going to call it "feedzirra" - I'm not a fan of github's ill-considered autopackaging fiasco.

If it were only the former, then rake gems:unpack:dependencies would do the trick.

However, at least curb (which feedzirra depends on) is building extensions, and those can't simply be unpacked. You could either get Dreamhost to install them (good luck) or install them into your user's local gem directory.

To do that, you'll need to update your .gemrc and be sure that it includes a line like: :user_install: true

Then rake gems:install

Unless your deployment environment won't let you build executables, in which case you'll need to shell out for a less restricted package - I know for a fact that Dreamhost does provide packages that will allow for extension-gems.

(And there's the separate issue of libcurl being deployed...)

Judson