diff --git a/Rakefile b/Rakefile
index c61016ef0..1292d040a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -26,7 +26,9 @@ which = lambda { |c|
 MAKE   = ENV['MAKE']   || %w[gmake make].find(&which)
 BUNDLE = ENV['BUNDLE'] || %w[bundle].find(&which)
 
-PKG_VERSION       = File.read('VERSION').chomp
+PKG_VERSION       = version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
+  /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
+end rescue nil
 
 EXT_ROOT_DIR      = 'ext/json/ext'
 EXT_PARSER_DIR    = "#{EXT_ROOT_DIR}/parser"
diff --git a/VERSION b/VERSION
deleted file mode 100644
index 24ba9a38d..000000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-2.7.0
diff --git a/json-java.gemspec b/json-java.gemspec
index b766fa2fd..5a5b61a52 100644
--- a/json-java.gemspec
+++ b/json-java.gemspec
@@ -1,6 +1,10 @@
+version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
+  /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
+end rescue nil
+
 spec = Gem::Specification.new do |s|
   s.name = "json"
-  s.version = File.read("VERSION").chomp
+  s.version = version
 
   s.summary = "JSON Implementation for Ruby"
   s.description = "A JSON implementation as a JRuby extension."
diff --git a/json.gemspec b/json.gemspec
index 9cd4ceee2..64d0c8139 100644
--- a/json.gemspec
+++ b/json.gemspec
@@ -1,6 +1,10 @@
+version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
+  /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
+end rescue nil
+
 Gem::Specification.new do |s|
   s.name = "json"
-  s.version = File.read(File.expand_path('../VERSION', __FILE__)).chomp
+  s.version = version
 
   s.summary = "JSON Implementation for Ruby"
   s.description = "This is a JSON implementation as a Ruby extension in C."
@@ -15,7 +19,6 @@ Gem::Specification.new do |s|
     "CHANGES.md",
     "LICENSE",
     "README.md",
-    "VERSION",
     "ext/json/ext/fbuffer/fbuffer.h",
     "ext/json/ext/generator/depend",
     "ext/json/ext/generator/extconf.rb",
diff --git a/json_pure.gemspec b/json_pure.gemspec
index 7b42a714e..c0ebc41e8 100644
--- a/json_pure.gemspec
+++ b/json_pure.gemspec
@@ -1,6 +1,10 @@
+version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
+  /^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
+end rescue nil
+
 Gem::Specification.new do |s|
   s.name = "json_pure".freeze
-  s.version = File.read("VERSION").chomp
+  s.version = version
 
   s.summary = "JSON Implementation for Ruby".freeze
   s.description = "This is a JSON implementation in pure Ruby.".freeze
@@ -14,7 +18,6 @@ Gem::Specification.new do |s|
     "CHANGES.md".freeze,
     "LICENSE".freeze,
     "README.md".freeze,
-    "VERSION".freeze,
     "json_pure.gemspec".freeze,
     "lib/json.rb".freeze,
     "lib/json/add/bigdecimal.rb".freeze,