Bug #9296
New versions of Ruby gems create problems when running rake tasks
| Status: | Accepted | Start date: | 09/01/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | - | |||
| Keywords: | Affected URL: | |||
| Branch: | Affected Dashboard version: | |||
| Votes: | 6 |
Description
I’m not sure exactly which version of gems started this issue, but under the 1.8 series (that’s of gems not ruby), running rake db:migrate results in errors.
NOTE: Gem.source_index is deprecated, use Specification. It will be
removed on or after 2011-11-01.
Gem.source_index called from /opt/puppet-dashboard/config/../vendor/
rails/railties/lib/rails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement.
It will be removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from /opt/puppet-dashboard/
config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:
100.
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
<SNIP - more deprecation warnings >
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib64/ruby/site_ruby/1.8/
rubygems/source_index.rb:91.
rake aborted!
no such file to load -- rdoc/task
(See full trace by running task with --trace)
If I install the rdoc gem I get this error instead:
<SNIP>
NOTE: Gem::SourceIndex#add_spec is deprecated, use
Specification.add_spec. It will be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from /usr/lib64/ruby/site_ruby/1.8/
rubygems/source_index.rb:91.
DEPRECATION WARNING: Rake tasks in vendor/plugins/delayed_job/tasks
are deprecated. Use lib/tasks instead. (called from /opt/puppet-
dashboard/vendor/rails/railties/lib/tasks/rails.rb:10)
rake aborted!
Could not find rack (~> 1.1.0) amongst [RubyRRDtool-0.6.0,
Sipper-2.0.0, activemodel-3.0.9, activerecord-3.0.9,
activesupport-3.0.9, arel-2.0.10, builder-2.1.2,
daemon_controller-0.2.6, diff-lcs-1.1.2, facets-1.8.54,
fastthread-1.0.7, flexmock-0.7.1, hoe-2.9.6, i18n-0.5.0, json-1.5.3,
log4r-1.0.5, mime-types-1.16, mysql-2.8.1, passenger-3.0.7,
rack-1.3.0, rake-0.9.2, rdoc-3.9.4, rest-client-1.6.3, rspec-2.6.0,
rspec-core-2.6.4, rspec-expectations-2.6.0, rspec-mocks-2.6.0, ruby-
shadow-2.1.2, stomp-1.1.9, tzinfo-0.3.28]
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
One way to resolve this is do downgrade ruby gems:
gem update --system 1.5.3
Another way around this particular issue according to Andrew Wasilczuk akw@zx23.net from the dashboard mailing list is to install the exact version of rack that we vendor
gem install rack --version=1.1.2
Long term, we need to figure out a better solution so that we work with newer versions of Ruby gems without a ton of deprecation warnings and with it not finding our vendored gems correctly – and still maintain backwards compatibility with older rubygems… If rubygems even makes that possible.
Related issues
History
Updated by Nigel Kersten 9 months ago
Is this us not vendoring properly? Or actually a problem with the upstream tools?
Is it definitely gems not rake that is the problem?
Updated by Alex Sharp 8 months ago
We’re having a similar problem with rake and puppet dashboard, except the bottom of our backtrace is the following:
<snip> NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. Gem::SourceIndex#add_spec called from /usr/local/rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:91. rake aborted! uninitialized constant ActiveSupport::Dependencies::Mutex
We’re using rubygems 1.8.10. We’re using rvm to manage our environment. I suppose it’s possible that the deprecation warnings are warning of something that has actually been removed from rubygems :) Unfortunately, rvm installs the most recent version of rubygems, which I’m guessing is causing this problem.
FWIW, I tried this with both rake 0.9.2 and 0.8.7 (0.9.2 is not easy to uninstall with rvm) and got the same errors.
Updated by Shakira Kaleel 5 months ago
it is working for the rubygems 1.7.2 and 1.3.5 [ gem update —system 1.7.2 / gem update —system 1.3.5 ] with rubygem-rake 0.8.7
But it is not working for 1.8.10.
i am using puppet-dashboard 1.2.3
Any suggestion?
Updated by Daniel Pittman 2 months ago
- Target version deleted (
141)