Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6875

Re: gem in path

From DON Who is a ghost <therocketforever@me.com>
Newsgroups comp.lang.ruby
Subject Re: gem in path
Date 2013-09-22 10:22 -0400
Organization therocketforever
Message-ID <l1muft$co8$1@speranza.aioe.org> (permalink)
References <37df80e6-a08c-4be3-adbe-83dfed93c515@googlegroups.com>

Show all headers | View raw


Have you checked out bundler?

http://bundler.io

it's fairly great at manageing gem dependencies. You specify your gems 
in the `Gemfile` run the `bundle install` command and boom. ready to go!

Generaly, I prefer to use the `require "bundler/setup"` method.

In in the first file you load in your app do:

    require "bundler/setup"
    Bundler.require(:default)

That will require all of the gems in you gemfile. You can also in your 
`Gemfile` do do:

    group :development do #or any symbol that you want to lable it with
	#gem "whatever_you_need"
	…
    end

and in your app:

    Bundler.require(:development)

And all of the gems will be required. this is really useful if your 
useing something like rack or sinatra to conditionaly require your gems 
for :testing, :development, or :production conditonaly.

1. `gem install bundler`
2. `bundle init` in your project root dir
3. specify your gems in `Gemfile`
4. `bundle install` in your project root

If you later add a new depedency then `bundle update` to rebuild the 
dependencys

When a user aqquires your code, they just have to `bundle install` and 
then start your app however you have designed that to work.







On 2013-09-22 13:48:52 +0000, ggarra13@gmail.com said:

> I have an application as a gem file that I want a copy to have 
> installed in the user's path directory upon gem install, similar to 
> rake.  I would like to know how to do that for my application.


-- 
---

#

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

gem in path ggarra13@gmail.com - 2013-09-22 06:48 -0700
  Re: gem in path DON Who is a ghost <therocketforever@me.com> - 2013-09-22 10:22 -0400
    Re: gem in path ggarra13@gmail.com - 2013-09-22 07:55 -0700
      Re: gem in path ggarra13@gmail.com - 2013-09-22 10:21 -0700

csiph-web