+19
app/init.rb
+19
app/init.rb
···
1
1
require 'blue_factory'
2
2
require 'sinatra/activerecord'
3
3
4
+
if defined?(RubyVM::YJIT) && RubyVM::YJIT.respond_to?(:enabled?)
5
+
if !RubyVM::YJIT.enabled?
6
+
if RubyVM::YJIT.respond_to?(:enable)
7
+
# Ruby 3.3+
8
+
RubyVM::YJIT.enable
9
+
else
10
+
# Ruby 3.2
11
+
puts "-" * 106
12
+
puts "Note: YJIT is not enabled. To improve performance, enable it by adding an ENV var RUBYOPT=\"--enable-yjit\"."
13
+
puts "-" * 106
14
+
end
15
+
end
16
+
else
17
+
puts "-" * 112
18
+
puts "Note: YJIT is not enabled. To improve performance, it's recommended to " +
19
+
((RUBY_VERSION.to_f >= 3.2) ? "install Ruby with YJIT support turned on." : "update to a newer Ruby with YJIT support.")
20
+
puts "-" * 112
21
+
end
22
+
4
23
ActiveRecord::Base.connection.execute "PRAGMA journal_mode = WAL"