Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

freegeoip-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freegeoip-rails

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build status

Freegeoip

This gem provides a simple Rails engine with an IP geolocation API that ducks with Freegeoip.

It reads MaxMindDB's open source GeoLite2 City database, with the help of maxminddb gem, a pure Ruby implementation.

You can find MaxMind's GeoLite2 City database here.

Installation

Add this line to your application's Gemfile:

gem "freegeoip-rails", require: "freegeoip"

Mount the engine in your routes file:

mount Freegeoip::Engine, at: "/json"

Add an initializer like config/initializers/freegeoip.rb and tell the engine where it can find your GeoLite2 City database:

  Freegeoip.configure do |config|
    # Anything that can be opened by OpenURI
    config.db_location = Rails.root.join "vendor/maxminddb/GeoLite2-City.mmdb"
  end

Start your web server and point your browser to http://localhost:3000/json/www.ruby-lang.org or http://localhost:3000/json/151.101.1.178 and you should get a response with JSON data.

Contributing

Contributions are always welcome.

Varvet

Crafted with love at Varvet digital agency. Skapad med omsorg av Varvet digital byrå.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 22 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc