Setting the environment in Gemfile for bundling install/update based on a customize file

前端 未结 1 1120
执念已碎
执念已碎 2021-02-11 09:40

hi, all I build a sinatra app, the main files for bundling as the following,

environment.rb

require \'sinatra\'
require \'sequel\'

ENV[\'RACK_ENV\'] = \         


        
相关标签:
1条回答
  • 2021-02-11 09:59

    When doing a bundler require you can specify which groups to be required.

    For example:

    require 'rubygems'
    require 'bundler'
    
    if ENV['RACK_ENV'] == 'development'
      Bundler.require(:default, :development)
    else
      Bundler.require(:default)
    require 'sinatra'
    

    More info on the bundler site gemfile specifications found here.

    0 讨论(0)
提交回复
热议问题