Jay Phillips's blog



Jay PhillipsJay Phillips
Standup 4/9/2010: New Bundler API Gotcha
edit Posted by Jay Phillips on Friday April 09, 2010 at 09:15AM

Interesting Things

Switching to Bundler 0.9.x?

If your old gem definitions use :lib => false, don't forget to change it to :require => false

Additionally, older versions of Bundler use the deprecated named argument :require_as (instead of Rails' :lib and Bundler 0.9's :require) to override the path that Bundle requires for you.

Here is an example of how to tell Bundler 0.9.x not to require a gem automatically:

gem "leetsauce", :require => false

Jay PhillipsJay Phillips
Standup 4/7/2010: Disabling Rails' IP Spoofing Safeguard
edit Posted by Jay Phillips on Wednesday April 07, 2010 at 09:46AM

Ask for Help

"How can Rails' IP spoof attack safeguards be disabled when its guesses give false positives that block out important users?"

When Rails has this safeguard in place, it may block out users behind poorly configured firewalls and some mobile devices.

The safeguard causes Rails to return a 500 and log the following message:

ActionController::ActionControllerError: IP spoofing attack?! HTTP_CLIENT_IP="16.89.XX.XXX" HTTP_X_FORWARDED_FOR="15.243.YY.YYY"

Rails 2.3 and later lets you easily disable this by overriding a setting in your environment.rb initializer:

Rails::Initializer.run do |config|
  config.action_controller.ip_spoofing_check = false
end

As always, be sure you understand the implications of disabling this security feature!

Jay PhillipsJay Phillips
Standup 4/6/2010: Milligan's Pants
edit Posted by Jay Phillips on Tuesday April 06, 2010 at 09:16AM

Milligan's Pants