Rails application as a gem - ruby-on-rails-3

Suppose I have a rails application. What should I do to create a gem from it and distribute it to heroku (for example)?

Related

How to setup spree_static_content with spree 3.X and rails 5 to generate static pages

I have been trying to setup gem spree_static_content with spree 3.X and rails 5 but there are endless errors (migrations not running, gem dependencies) which are coming. Documentation is outdated and no help on any of the gems and spree commerce project. If someone has recently used these projects please share the debugging results.
When setting up spree_static_content gem with Rails 5.x and spree 3.x there are various errors you will get when you add only gem spree_static_content to your Gemfile.
Install following gems to your Gemfile and you will not get any error and will easily setup cms for static content for your application.
gem 'spree_static_content', github: 'spree-contrib/spree_static_content'
gem 'globalize', git: 'https://github.com/globalize/globalize'
gem 'activemodel-serializers-xml'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize'
Next, run following commands
bundle install
bundle exec rails g spree_i18n:install
bundle exec rails g spree_globalize:install
bundle exec rails g spree_static_content:install
Now, simply create pages from admin but don't forget to select the store-name checkbox for route to work for spree 3.x.

rails 3.2 rails with backbone, can sprockets and requireJs works together?

In the context of a rails 3.2 rails with backbone, can sprockets and requireJs works together? cannot figure it out myself or find on the web.
I think you want to use sprockets OR requirejs, but not both. There is a gem for easy use of requirejs in rails (https://github.com/jwhitley/requirejs-rails/).

what does omniauth 1.0.1 do?

I'm currently trying to use omniauth in my rails application. I was just curious, what does the omniauth 1.0.1 gem do now that the provider strategies come in separate gems like omniauth-facebook?
'omniauth 1.0.1' gem is core library.
'omniauth-facebook' gem is current provider implementation.
Docs

video upload in rails 3

Is there any gem or plugin for uploading videos in rails application? can anybody suggest a gem or plugin for uploading videos in rails 3? please help me in this regard with a tutorial.. Im new to rails.
I created a gem for this very specific reason: https://rubygems.org/gems/paperclip-ffmpeg

Editing a gem definition on HEROKU (opentok)

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!!
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.
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!