# Can anyone give a quick explaination

**URL:** <https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916>\
**Category:** Rails\
**Created:** [April 19, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916 "2009-04-19T21:31:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [April 19, 2009, 9:31pm UTC](https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916/1 "2009-04-19T21:31:31Z")

</div>

Hey all!

I’ve got an app on a shared host at the moment.

They load ruby gems into a dir onto my space: home/myusername/ruby/  
gems/gems and recommend that you include this path by adding it to the  
load\_path like so:

$:.push(“home/myusername/ruby/gems/gems”)

My question is - is this the same as adding

config.load\_paths += %w(home/myusername/ruby/gems/gems)

to the environment.rb file?

If so - cool!  
If not, can anyone explain what the difference is?

Thanks

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [April 19, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916/2 "2009-04-19T21:46:45Z")

</div>

On Apr 19, 8:29 pm, Gavin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> My question is - is this the same as adding
> 
> config.load\_paths += %w(home/myusername/ruby/gems/gems)
> 
> to the environment.rb file?
> 
> If so - cool!  
> If not, can anyone explain what the difference is?

No - $: (and the various other names it has) is using by ruby when you  
write require ‘foo’

config.load\_paths (which eventually gets stored in  
ActiveSupport::Dependencies.load\_paths) is the set of paths that is  
searched by rails’ magic loading stuff.

Fred

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [April 19, 2009, 10:33pm UTC](https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916/3 "2009-04-19T22:33:37Z")

</div>

Alrighty - thanks Fred

Out of curiosity Fred - do you or anyone else reading have much  
experience with using RMagick on a shared host?

Having a major headache trying to get rails to load the RMagick gem  
and my host’s technical help are not being so helpful

Thanks

Gavin

On Apr 19, 8:45 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [April 21, 2009, 2:55am UTC](https://www.ruby-forum.com/t/can-anyone-give-a-quick-explaination/165916/4 "2009-04-21T02:55:02Z")

</div>

Not 100% sure what the difference is, but they’re both WRONG. Adding  
gem directories like that to the load path will only work for suitably  
small values of “work”. Try the instructions here:

[http://blog.juliankamil.com/article/26/installing-your-own-ruby-gems-in-a-shared-hosting-environment](http://blog.juliankamil.com/article/26/installing-your-own-ruby-gems-in-a-shared-hosting-environment)

to get this set up _correctly_. It might not seem like a big deal at  
first, but the method recommended by your provider will break if gems  
depend on other gems in your local repository.

–Matt J.
