Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to add Mac-specific gems to bundle on Mac but not on Linux?
    primarykey
    data
    text
    <p>I'm developing a Rails app on a Mac, and I'm new to testing, so I just added these gems to my <strong>Gemfile</strong>:</p> <pre><code>group :test, :development do gem 'rspec-rails' gem 'rb-fsevent' gem 'growl' end </code></pre> <p>But my production server runs Linux, so even if they aren't grouped in <code>:production</code>, bundler (<em>v1.0.21</em>) still attempts to install them. ...and fails, obviously!<br> <code>extconf.rb:19:in '&lt;main&gt;': Only Darwin (Mac OS X) systems are supported (RuntimeError)</code></p> <p>Setting <code>RAILS_ENV</code> to production before running <code>bundle install</code> <em>doesn't work</em>.</p> <p>It worked by running <code>bundle install --without development test</code>, but how can these gems be taken into consideration by bundler only based on your OS?</p> <hr> <p><strong>Edit:</strong> The bundler wiki provides details on how to <a href="https://github.com/carlhuda/bundler/wiki/Platform-as-a-parameter">use platform as a parameter</a>.<br> The same solution is given in <a href="https://github.com/carlhuda/bundler/issues/663">bundler issue #663</a>, so I tried:</p> <pre><code>group :test, :development do gem 'rspec-rails' platforms :darwin do gem 'rb-fsevent' gem 'growl' end end </code></pre> <p><code>bundle install</code> does not work, but even if we go back to square one and do<br> <code>bundle install --without darwin</code>, the result is <code>'darwin' is not a valid platform.<br> The available options are: [:ruby, :ruby_18, :ruby_19, :mri, :mri_18, :mri_19, :rbx, :jruby, :mswin, :mingw, :mingw_18, :mingw_19]</code></p> <hr> <p>Any other (elegant) approaches?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload