Merge pull request #5085 from tchak/fix-crash-on-boot-without-geos
Fix crash on boot without geos
This commit is contained in:
commit
92edbd1724
5 changed files with 10 additions and 11 deletions
|
@ -14,14 +14,14 @@ bundle_restore_cache: &bundle_restore_cache
|
||||||
restore_cache:
|
restore_cache:
|
||||||
name: Restore Bundler Package Cache
|
name: Restore Bundler Package Cache
|
||||||
keys:
|
keys:
|
||||||
- bundle-install-v9-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
- bundle-install-v10-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
||||||
- bundle-install-v9-{{ arch }}
|
- bundle-install-v10-{{ arch }}
|
||||||
- bundle-install-v9
|
- bundle-install-v10
|
||||||
|
|
||||||
bundle_save_cache: &bundle_save_cache
|
bundle_save_cache: &bundle_save_cache
|
||||||
save_cache:
|
save_cache:
|
||||||
name: Save Bundler Package Cache
|
name: Save Bundler Package Cache
|
||||||
key: bundle-install-v9-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
key: bundle-install-v10-{{ arch }}-{{ checksum "Gemfile.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ~/vendor/bundle
|
- ~/vendor/bundle
|
||||||
|
|
||||||
|
|
1
Gemfile
1
Gemfile
|
@ -25,7 +25,6 @@ gem 'devise' # Gestion des comptes utilisateurs
|
||||||
gem 'devise-async'
|
gem 'devise-async'
|
||||||
gem 'discard'
|
gem 'discard'
|
||||||
gem 'dotenv-rails', require: 'dotenv/rails-now' # dotenv should always be loaded before rails
|
gem 'dotenv-rails', require: 'dotenv/rails-now' # dotenv should always be loaded before rails
|
||||||
gem 'ffi-geos'
|
|
||||||
gem 'flipper'
|
gem 'flipper'
|
||||||
gem 'flipper-active_record'
|
gem 'flipper-active_record'
|
||||||
gem 'flipper-ui'
|
gem 'flipper-ui'
|
||||||
|
|
|
@ -215,8 +215,6 @@ GEM
|
||||||
faraday (0.15.4)
|
faraday (0.15.4)
|
||||||
multipart-post (>= 1.2, < 3)
|
multipart-post (>= 1.2, < 3)
|
||||||
ffi (1.12.2)
|
ffi (1.12.2)
|
||||||
ffi-geos (2.1.0)
|
|
||||||
ffi (>= 1.0.0)
|
|
||||||
flipper (0.17.2)
|
flipper (0.17.2)
|
||||||
flipper-active_record (0.17.2)
|
flipper-active_record (0.17.2)
|
||||||
activerecord (>= 4.2, < 7)
|
activerecord (>= 4.2, < 7)
|
||||||
|
@ -753,7 +751,6 @@ DEPENDENCIES
|
||||||
discard
|
discard
|
||||||
dotenv-rails
|
dotenv-rails
|
||||||
factory_bot
|
factory_bot
|
||||||
ffi-geos
|
|
||||||
flipper
|
flipper
|
||||||
flipper-active_record
|
flipper-active_record
|
||||||
flipper-ui
|
flipper-ui
|
||||||
|
|
|
@ -48,8 +48,11 @@ Les informations nécessaire à l'initialisation de la base doivent être pré-c
|
||||||
|
|
||||||
Sous Ubuntu, certains packages doivent être installés au préalable :
|
Sous Ubuntu, certains packages doivent être installés au préalable :
|
||||||
|
|
||||||
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev libcurl4-gnutls-dev zlib1g-dev
|
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev libcurl4-gnutls-dev zlib1g-dev libgeos-dev
|
||||||
|
|
||||||
|
Sous Mac, certains packages doivent être installés au préalable :
|
||||||
|
|
||||||
|
brew install geos
|
||||||
|
|
||||||
Afin d'initialiser l'environnement de développement, exécutez la commande suivante :
|
Afin d'initialiser l'environnement de développement, exécutez la commande suivante :
|
||||||
|
|
||||||
|
|
|
@ -55,13 +55,13 @@ class GeoArea < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def area
|
def area
|
||||||
if polygon?
|
if polygon? && RGeo::Geos.supported?
|
||||||
rgeo_geometry.area.round(1)
|
rgeo_geometry.area.round(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def length
|
def length
|
||||||
if line?
|
if line? && RGeo::Geos.supported?
|
||||||
rgeo_geometry.length.round(1)
|
rgeo_geometry.length.round(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue