Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've run into the same problem.</p> <p><em><strong>Even when I explicitly specify the version of activesupport to use</em></strong> in my Gemfile:</p> <pre><code>gem 'rails', '3.2.9' gem 'activesupport', '3.2.9' </code></pre> <p>it still gives me this error when I run <code>bundle exec rails s</code>:</p> <pre><code>/home/tyler/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.0.18/lib/bundler/runtime.rb:31:in `block in setup': You have already activated activesupport 3.2.10, but your Gemfile requires activesupport 3.2.9. Consider using bundle exec. (Gem::LoadError) </code></pre> <p>This happens for me when I want to try going back to an older version of Rails in my app to test a difference between the two versions of Rails.</p> <p>So even creating a separate gemset for my app (which we usually do anyway) does not solve the problem, because the gemset was "polluted" by this app itself (by temporarily installing/using Rails 3.2.10 before going back to Rails 3.2.9), not by some other app!</p> <p><strong>The only solution I've found so far</strong> is to <strong>uninstall</strong> the newer version that you don't want it to use:</p> <pre><code>gem uninstall activesupport -v 3.2.10 </code></pre> <p>It seems like this is either a bug in Bundler or a bug in Rails (if it does something that causes activesupport to be loaded/activated <em>before</em> it loads Bundler, then we can't really blame it on Bundler...).</p> <p><strong>Another equally terrible solution:</strong> To disable a newer version of a gem <em>temporarily</em> <strong>without uninstalling</strong> it, you can edit the gem's specification file (for example, <code>/home/tyler/.rvm/gems/ruby-1.9.3-p194/specifications/activesupport-3.2.10.gemspec</code>) and add a line <code>raise 'disabled'</code> at the top. Bundler will skip the loading of <code>activesupport 3.2.10</code> (after rescuing and printing the error) and proceed to load the next highest version of <code>activesupport</code> that it can find (<code>activesupport 3.2.9</code>).</p> <p>When you're ready to re-enable <code>activesupport 3.2.10</code>, simply remove the <code>raise</code>.</p> <p>This may be quicker than uninstalling and reinstalling a gem, if you just want to test something with the older version before going back to the newer version of them gem.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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