tags:

views:

90

answers:

1

So I've got thin installed the old fashioned way:

gem install thin

I put an app on the server and installed all of its required gems via bundler:

bundle install

But, when I tried to start the app with thin start, it can't find any of the bundler-installed gems since they're not installed in the default gems directory.

My question is: how do I make this work? Do I need to install thin via bundler as well? Will that still set up the thin executable in /usr/bin so I can start it from the command line like normal? Thanks!

A: 

Found it. Bundler has a little setup method that gets all require paths ready so that the ones bundler itself installed are available just like regular gems:

require 'rubygems'
require 'bundler'
Bundler.setup
require 'sequel'

In this case sequel was installed with bundler, not rubygems. So calling it without the Bundle.setup call first would not work. But with Bundle.setup, the location of all the bundler-installed gems is added to the load path so ruby can find them. Easy!

Rob Cameron