Rails config/environment.rb

Today the company I host my sharepdf.com site updated their Rails platform from 1.2.3 to 1.2.5 and all of sudden my Ruby on Rails application that gives users an HTML (suitable for an iPhone) view of the Adobe Share library stopped working. The following error message kept appearing in the error log:


Cannot find gem for Rails ~>1.2.3.0: Install the missing gem with 'gem install -v=1.2.3 rails', or change environment.rb to define RAILS_GEM_VERSION with your desired version.

I had to edit the config/environment.rb file and update the Rails version from 1.2.3 to 1.2.5.


# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '1.2.5' unless defined? RAILS_GEM_VERSION

This change fixed the problem.

Advertisement

2 Responses to “Rails config/environment.rb”

  1. Andy Knight Says:

    Hey thanks for this post SO MUCH! I found it when I was googling for the error message that my Bluehost server logs was giving me. It sure would be nice if they would let us know when they upgraded. I don’t know much about RoR, so your post saved the day. Thx.

  2. sj Says:

    Actually a better way to address this is to comment out the RAILS_GEM_VERSION ; this way you’ don’t have to update this statement each time the hosting company updates the Ruby on Rails system.

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.