Skip to content

Commit

Permalink
Make bootsnap MRI only for now
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Feb 25, 2018
1 parent b301c9f commit c234a14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ source 'https://rubygems.org'
# if there is a super emergency and rubygems is playing up, try
#source 'http://production.cf.rubygems.org'

# does not install in linux ATM, so hack this for now
gem 'bootsnap', require: false
gem 'bootsnap', require: false, platform: :mri

def rails_master?
ENV["RAILS_MASTER"] == '1'
Expand Down
24 changes: 15 additions & 9 deletions config/boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

if ENV['RAILS_ENV'] != 'production' && ENV['RAILS_ENV'] != 'profile'
require 'bootsnap'
begin
require 'bootsnap'
rescue LoadError
# not a strong requirement
end

Bootsnap.setup(
cache_dir: 'tmp/cache', # Path to your cache
load_path_cache: true, # Should we optimize the LOAD_PATH with a cache?
autoload_paths_cache: true, # Should we optimize ActiveSupport autoloads with cache?
disable_trace: false, # Sets `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }`
compile_cache_iseq: true, # Should compile Ruby code into ISeq cache?
compile_cache_yaml: false # Skip YAML cache for now, cause we were seeing issues with it
)
if defined? Bootsnap
Bootsnap.setup(
cache_dir: 'tmp/cache', # Path to your cache
load_path_cache: true, # Should we optimize the LOAD_PATH with a cache?
autoload_paths_cache: true, # Should we optimize ActiveSupport autoloads with cache?
disable_trace: false, # Sets `RubyVM::InstructionSequence.compile_option = { trace_instruction: false }`
compile_cache_iseq: true, # Should compile Ruby code into ISeq cache?
compile_cache_yaml: false # Skip YAML cache for now, cause we were seeing issues with it
)
end
end

0 comments on commit c234a14

Please sign in to comment.