简体   繁体   中英

Rails 3.2 - `bundle install` fails due to Gemnasium error after Ruby reinstall

I'm working on an app that I inherited so sometimes I come across config-related stuff that I can't solve. Long story short: I use rbenv to manage ruby versions on my local machine and recently I was trying to delete one version of Ruby that I don't use and accidentally deleted the one used in my app (version is 1.9.3-p392).

So I used rbenv to reinstall 1.9.3-p392 and ran bundle install in my app directory but got the following error:

Could not find gem 'gemnasium (>= 0) ruby' in the gems available on this machine. 

I get the same error when running rails console or rails server . In an attempt to solve the problem I ran gem install gemnasium and got the following error:

ERROR:  Could not find a valid gem 'gemnasium' (>= 0) in any repository

...which makes sense because when I go to eg rubygems.org, there is no "Gemnasium" gem. So then I don't know why gem "gemnasium" was in Gemfile to begin with or what it's used for.

In an attempt to move on and come back to the problem later, I simply commented out gem 'gemnasium' in Gemfile . However, doing that has led to the following problem when I try to deploy to Staging with Capistrano when getting to the assets precompile part:

INFO[ce9f38e3] Running bundle exec rake assets:precompile on http01-staging.my_app.com
DEBUG[ce9f38e3] Command: cd /u/apps/my_app/releases/20141126184705 && ( RAILS_ENV=staging bundle exec rake assets:precompile )
DEBUG[ce9f38e3]     rake aborted!
DEBUG[ce9f38e3]     LoadError: cannot load such file -- gemnasium
/u/apps/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/u/apps/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block in require'
/u/apps/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/u/apps/my_app/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/u/apps/my_app/releases/20141126184705/lib/tasks/gemnasium.rake:2:in `block in <top (required)>'
/u/apps/my_app/releases/20141126184705/lib/tasks/gemnasium.rake:1:in `<top (required)>' 

So...basically I have no idea why Gemnasium is in here to begin with or how to get it back into my Gemfile successfully. Any ideas??

Appears your gemnasium gem is deprecated ( and not showing in rubygems.org, you should trying installing it directly from source on github.

Add the following line to your Gemfile and run bundle install

gem 'gemnasium', :git => 'git://github.com/gemnasium/gemnasium-gem.git' 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM