1

quick question about Heroku. My app is using a gem called opentok. To function outside of a "sandbox" mode, the app requires changing an API link in a gem file called opentok.rb. I did that locally and the app works fine. however, when I deploy to heroku, the app does not work because heroku looks at my gem file and gets the unmodified gem lib of opentok which then runs my app on the heroku server in sandbox mode.

Is there a way I can access the opentok gem file (opentok.rb) on the heroku server and edit it with gvim from a console?

Thank you!!

sybohy
  • 1,856
  • 2
  • 20
  • 25

2 Answers2

3

Unpack the gem to your vendor directory, edit it as you require, then tell Bundler where to retrieve the gem from.

Command line:

gem unpack opentok-VERSION --target vendor/gems

Bundler:

gem 'opentok', :path => "vendor/gems/opentok-VERSION"

After you've done all this, do a bundle install, add the vendored Gem to your git repository, and push to heroku.

Douglas F Shearer
  • 25,952
  • 2
  • 48
  • 48
  • 1
    I would say this is the _correct_ answer to the question as it can be applied to other gems, even though the other post did solve the OP's problem. Thanks Douglas! – MandM Apr 01 '13 at 14:40
0

For the opentok gem, though, the api url can be passed directly as an option:

opentok = OpenTok::OpenTokSDK.new @api_key, @api_secret, :api_url => 'https://api.opentok.com/hl'

this feature is documented in the spec/opentok_spec.rb file. Look for:

it "should be possible to set the api url as an option" do

Thanks to Stijnster, the opentok gem creator, for pointing it out to me!

sybohy
  • 1,856
  • 2
  • 20
  • 25