Forum: Ruby on Rails can anyone give a quick explaination...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-19 21:31
(Received via mailing list)
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
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-19 21:46
(Received via mailing list)
On Apr 19, 8:29 pm, Gavin <ga...@thinkersplayground.com> 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
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin Morrice (dr_gavin)
on 2009-04-19 22:33
(Received via mailing list)
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 Cheung <frederick.che...@gmail.com>
6883e5ef03484d4fcef507d7b4f1d243?d=identicon&s=25 Matt Jones (Guest)
on 2009-04-21 02:55
(Received via mailing list)
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-...

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 Jones
This topic is locked and can not be replied to.