FYI, fixing Permission denied – /root/.gems (rails/passenger error)

I thought I’d save some other people some hassle.

Something changed at dreamhost and my rails sites stopped loading correctly. Instead of getting my website, I was getting a passenger error:

Permission denied – /root/.gems

The problem is easy to fix:



To the top of your config/boot.rb file.

So my config/boot.rb now looks like this:

require 'rubygems'
gem 'bundler' #koz added
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'
rescue Bundler::GemNotFound => e
  STDERR.puts e.message
  STDERR.puts "Try running `bundle install`."
end if File.exist?(gemfile)

Hope this helps someone else avoid having to figure it out.

Works for me. Many thanks! Still curious what has change (default gem paths?)

Honestly I have no idea, I know just enough rails to hack together a site for my wedding. The ins and outs of the details are still a mystery to me.

Thanks a lot - saved me hours I’m sure :slight_smile:

Thanks dude - absolutely panicked when I saw that and I started mucking around with DNS settings to a back up server under my control, but then I found this post - phew! :slight_smile:

This fixed my pages, but I had problems with running rails commands after applying the fix. It seems to work if you flip the order of the first two:

require 'rubygems'

Thanks a lot! This finally solves the issue for me, too.

Many Thanks!!!
Saved me hours!!

I confirm that the order should be:

require 'rubygems’

Happened to me and that fixed it for me also - thanks!