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

前端 未结 1 1219
我寻月下人不归
我寻月下人不归 2021-02-11 09:25

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:48

    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)
提交回复
热议问题