How to add Mac-specific gems to bundle on Mac but not on Linux?

后端 未结 5 1639
感动是毒
感动是毒 2020-12-15 04:04

I\'m developing a Rails app on a Mac, and I\'m new to testing, so I just added these gems to my Gemfile:

group :test, :development do
  gem          


        
5条回答
  •  半阙折子戏
    2020-12-15 04:39

    Gemfile actually is a regular ruby file, so you can use something like

    case RUBY_PLATFORM
    when /darwin/
      gem 'foo'
    when /win32/
      gem 'bar'
    end
    

提交回复
热议问题