I’m trying to use config/environment.rb to install a ruby gem dependency (because I don’t have sudo access to our server; ergo, can’t just call gem install hpricot).
I’ve tried including sundry arguments (:version, :source, :lib) but I still get rake aborted! no such file to load -- hpricot
Update: It turns out that when I remove the plugin which requires hpricot, then I can execute rake gems:install successfully. But that’s not very helpful. It means that if I ever move my app, I run into a problem of being unable to rake its gems (because I will have reinstalled the plugin and added features that depend on it).
How is this supposed to work?
Sys: WinXP, Ruby 1.8.7, Rails 2.3.5
rake gems:installhas been deprecated because it never really worked. You can imagine having a gem installer with dependencies to the very gems it’s trying to install is a bad idea.It’s advisable to use bundler instead if that’s an option.
Bundler allows you to install gems to any destination you want, something specifically intended to side-step the whole “requires
sudo” problem you describe. It’s often as easy as this:You can make your Rails 2.3.x application use Bundler by following a few simple steps and from there your life will be a lot easier.