White Listing REMOTE_ADDR for better_errors gem

rails
ruby

#1

I really like the experience of doing Ruby on Rails development on c9 you guys of pretty much nailed it. The only really frustrating thing I have found so far is that I’m unable to use the better_errors gem because the REMOTE_ADDR IP in the app preview is dynamic and keeps on changing. I tried white listing a range of IPs

 if ENV['C9_IP']
    for i in (1..200)
      BetterErrors::Middleware.allow_ip! "10.240.0.#{i.to_s}"
    end
 end

But that didn’t work. The range is white listed but better_errors still does not consider it white listed. Any ideas?


#2

I’m not familiar with using that gem but you could have a look at the workspace IP addresses to whitelist and try adding those to your whitelist.


#3

Does https://github.com/charliesome/better_errors/issues/318 help? It did for me.


#4

Yes is it did help. Thanks for sharing!