Search code examples
ruby-on-railscapistranobundlerrvm-capistrano

How to deploy a private gem using capistrano


We have a gem which is specific to our project and is also shared among multiple projects. When we try to install our Gemfile using bundle:install command via capistrano, it fails mentioning that it is unable to find the sources for foo-1.0.0.gem

** [out :: [email protected]] Could not find foo-1.0.0 in any of the sources

How should I resolve this, since I cannot expose this gem in a public repository. What would be the right way to bundle and deploy.


Solution

  • I believe you should provide the source for the gem like this:

    gem 'foo', :git => 'https://my_username:[email protected]/my_github_account/my_repo.git'
    

    If this is not an option for you, you might need to setup your own gem server or vendor the gem