Note that there are some explanatory texts on larger screens.

plurals
  1. POMake bundler use different gems for different platforms
    primarykey
    data
    text
    <p>I'm working on upgrading one of our Rails 2.3.8 apps to Rails 3, and have run into an annoying problem with bundler and deployment. I develop the application on a Windows machine, but the production environment is running Ubuntu Linux. Now, my problem is that bundler is ignoring the <code>mysql</code> gem in the production environment, and Passenger spits out: <strong>"!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'"</strong></p> <p>Here is my <code>Gemfile</code>:</p> <pre><code># Edit this Gemfile to bundle your application's dependencies. # This preamble is the current preamble for Rails 3 apps; edit as needed. source 'http://rubygems.org' gem 'rails', '3.0.0' gem 'net-ldap', :require =&gt; 'net/ldap' gem 'highline', :require =&gt; 'highline/import' gem 'mysql', '2.8.1' gem 'net-ssh', :require =&gt; 'net/ssh' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators # and rake tasks are available in development mode: group :development, :test do gem 'fakeweb', :require =&gt; 'fakeweb' gem 'flexmock', :require =&gt; 'flexmock/test_unit' end </code></pre> <p>As you can see, the <code>mysql</code> gem is specified. However, when deploying, bundler ignores it. Why? The reason is that Bundler generates the following <code>Gemfile.lock</code> (only relevant parts included):</p> <pre><code>.... mime-types (1.16) mysql (2.8.1-x86-mingw32) net-ldap (0.1.1) .... </code></pre> <p>Notice that it includes the platform specific gem. This is obviously NOT what I want it to do, as that gem is not suitable (and appearently ignored) when running under Linux.</p> <p>So, does Bundler come with any way to deal with these issues? Or do I have to remember to manually change the mysql gem version in the generated <code>Gemfile.lock</code> every time I run bundle install on my development machine?</p> <p>Thank you in advance!</p> <p><strong>Update</strong></p> <p>It seems like the bundler team is aware of this <a href="https://github.com/carlhuda/bundler/issues#issue/635" rel="noreferrer">issue</a>.</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.
 

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