can't find gems in /vendor/gems/ after modifying load_paths

Take a careful look at the errtheblog article - you should be using require, not gem here. The gem statements only add the gem directories to the load_path.

In the long run, you should definitely switch over to using config.gem, but that isn't an option with Rails 2.0.3.

BTW, even changing to 'require's is still going to leave you with problems, as RMagick's native component hasn't been built yet. I don't know of any easy way to do it in your situation. You might want, for the short term, to just leave the 'gem' lines in your environment and keep the gem packages for the gems you need around. That way, the code will complain loudly if the gems needed aren't installed.

--Matt Jones

Matt Jones wrote:

Take a careful look at the errtheblog article - you should be using require, not gem here. The gem statements only add the gem directories to the load_path.

Changing to 'require' got past that error. I still don't understand why it failed to load since I had requires elsewhere that just didn't specify the version. Where would I look up the syntax reference for 'gem' and 'require' ? I'm not really clear where those come from. I see 'require' documented here: http://www.rubygems.org/read/chapter/3 but it doesn't reference the version argument and I don't see where 'gem' is documented.

In the long run, you should definitely switch over to using config.gem, but that isn't an option with Rails 2.0.3.

I'll give that a look when we upgrade.

BTW, even changing to 'require's is still going to leave you with problems, as RMagick's native component hasn't been built yet. I don't know of any easy way to do it in your situation.

Thanks for the warning.

You might want, for the short term, to just leave the 'gem' lines in your environment and keep the gem packages for the gems you need around. That way, the code will complain loudly if the gems needed aren't installed.

Hmmm... so it seems that 'gem' just declares that the code depends on a gem, and 'require' actually loads the library?

Thanks so much! Sarah

DON'T DO THAT. That's from a very old tip that no longer applies to current (2.2+) versions of Rails. See this link: http://api.rubyonrails.org/classes/Rails/Configuration.html#M002480

--Matt Jones

"Fails to start" is not very helpful - what error message do you get? It'll be helpful to know what version of Rails you're running, and the output of 'rake gems'. If that errors out, try 'rake gems --trace' to get a detailed error.

--Matt Jones