A
A
Anton Ivanov2015-05-18 00:19:54
Ruby on Rails
Anton Ivanov, 2015-05-18 00:19:54

How to correctly register your gem in the Gemfile? Or how to properly deploy it?

Hello.
There is a ruby ​​module that describes the model and three applications that use this module.
In the Gemfile, respectively, this line:

gem 'app_model', path: '/usr/local/www/sites/app_files/app_model'

but when I deploy to the server using capistrano, the path on the server is /usr/local/www/sites/app_files/app_model/current
The problem is that one gem cannot be written in the Gemfile (even with different directories) for different groups (:production, :deploy). When I do a bundle update, he swears that
Your Gemfile lists the gem app_model (>= 0) more than once.

I know about the hack using it, but maybe there is a normal way to solve this problem? if ENV['RACK_ENV'] == "development"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Vsk, 2015-05-18
@viktorvsk

And what's the problem with using a relative path and adding the gem directly to the directory, or, for example, one level higher?
You can upload it to github
But in general, in fact, even though the decision to give part of the functionality to the gem seems to be not bad, you need to support it quite seriously and first it’s better to think three times and weigh everything

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question