Skip to content

Commit 6f442ea

Browse files
committed
Delay loading securerandom until after bundler setup
On ruby 3.x you can get an error like this if you run this without securerandom:0.4.1 (required by the lockfile) installed: > in `check_for_activated_spec!': You have already activated securerandom 0.3.1, but your Gemfile requires securerandom 0.4.1. Since securerandom is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports securerandom as a default gem. (Gem::LoadError)
1 parent 5eca368 commit 6f442ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmarks/shipit/benchmark.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
require 'securerandom'
1+
require_relative '../../harness/loader'
22

33
ENV['RAILS_ENV'] ||= 'production'
44
ENV['DISABLE_DATABASE_ENVIRONMENT_CHECK'] = '1' # Benchmarks don't really have 'production', so trash it at will.
5-
ENV['SECRET_KEY_BASE'] = SecureRandom.hex(128)
65
ENV['SHIPIT_DISABLE_AUTH'] = '1' # Saves us lots of trouble
76

8-
require_relative '../../harness/loader'
9-
107
Dir.chdir __dir__
118
use_gemfile
129

10+
require 'securerandom'
11+
ENV['SECRET_KEY_BASE'] = SecureRandom.hex(128)
12+
1313
require_relative 'config/environment'
1414
require_relative "route_generator"
1515

0 commit comments

Comments
 (0)