Is there a best practice for when an app requires a gem?

Hi there,

Is there a standard/recommended way for a Rails app to express a
dependency on a gem? For non-rails projects, we could package as a gem
and hence use the gem spec to express dependencies.

I suppose I could do it by hand in environment.rb, but it seems like
there ought to be a cleaner way. Am I missing something?

Thanks,

Brian H.

Brian H. wrote:

Is there a standard/recommended way for a Rails app to express a
dependency on a gem?

Try this: The program emits “no such file to load – foo”

The user responds with: sudo gem install foo

Problem solved. Just don’t go crazy and call your primary include file
‘luxury_yacht’, while your gem is called ‘throat_warbler_mangrove’. Name
them
the same so the error message

The rule “same thing same name” is a very important tenant of lean and
clean
programming.


Phlip

On 1 May 2008, at 03:17, Brian H. wrote:

Hi there,

Is there a standard/recommended way for a Rails app to express a
dependency on a gem? For non-rails projects, we could package as a
gem
and hence use the gem spec to express dependencies.

I suppose I could do it by hand in environment.rb, but it seems like
there ought to be a cleaner way. Am I missing something?

http://ryandaigle.com/articles/2008/4/1/what-s-new-in-edge-rails-gem-dependencies

Fred