Question

I'm running a Rails 3.2 app that depends on an offline gem, chilkat. (http://www.chilkatsoft.com/ruby.asp).

I've gotten this to work on my development environment by doing the following:

  1. Unpacking the gem into my vendor/gems folder
  2. Adding this line to my Gemfile

    gem 'chilkat', '9.4.1', path: 'vendor/gems/chilkat-9.4.1-universal-darwin-12', require: false    
    

(These steps were taken from How to use Bundler with offline .gem file?)

BUT when I push the code to Heroku, the app crashes with the error:

/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:317:in `rescue in depend_on': No such file to load -- chilkat (LoadError)

Do you know what I need to do to get the gem installed properly on Heroku? Thanks!

Was it helpful?

Solution

Ok I figured out the issue. The Chilkat gem I'm using has OS-specific versions, and the version I unbundled in vendor/gems is for OSx won't work on Heroku/AWS. So even if the path would have worked correctly in Heroku, the gem itself would not.

The problem I face now is because the Chilkat gem is OS-specific, Bundler will generate a Gemfile.lock file specific to the OS on which bundle install was called (OSx in my case). That OSx-specific Gemfile.lock is incompatible with AWS's machines, so Heroku complains that I can't push the code since the Gemfile.lock is inconsistent with what is expected.

This appears to be a known issue with Bundler (How to add Mac-specific gems to bundle on Mac but not on Linux?). I could just avoid committing Gemfile.lock, but we rely on the version dependency management that Gemfile.lock provides. And I don't want to get all the developers on my team to switch to developing on Linux/Unix. Anyway that's a separate issue so I'm closing this for now. Thanks to the people who commented!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top