Rails. Gem bundle failed
after I run:
bundle install
I got:
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14:in
<top (required)>': undefined method
remove' for Gem::QuickLoader:Module (NoMethodError) from :158:inrequire' from <internal:gem_prelude>:158:in
load_full_rubygems_library' from :280:inmethod_missing' from /usr/local/bin/bundle:19:in
' mat@Macbook-Pro~/Documents/workspace/RoR/rails_projects/sample_app$
Edited:
>bundle -v
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14:in `<top (required)>': undefined method `remove' for Gem::QuickLoader:Module (NoMethodError)
from <internal:gem_prelude>:158:in `require'
from <internal:gem_prelude>:158:in `load_full_rubygems_library'
from <internal:gem_prelude>:280:in `method_missing'
from /usr/local/bin/bundle:19:in `<main>'
mat@Macbook-Pro~$ gem -v
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:86:in `<top (required)>': undefined method `load_plugins' for Gem:Module (NoMethodError)
from /usr/local/bin/gem:9:in `require'
from /usr/local/bin/gem:9:in `<main>'
My Gemfile is :
>
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3', '1.3.3'
group :development do
gem 'rspec-rails', '2.6.1'
end
group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.1'
end
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger (ruby-debug fo开发者_C百科r Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# 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 'webrat'
# end
Could anybody help me?THanks!
I faced with a similar error:
$ bundle -v
/Users/Reza/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/site_ruby/1.9.1/rubygems.rb:14:in `<top (required)>': undefined method `remove' for Gem::QuickLoader:Module (NoMethodError)
It seems that all [..]/rubygems.rb Undefined method[..] issues is related to a conflict between installed rubygems (e.g. via rvm rubygems) and built in rubygems methods in ruby 1.9.x
just rename the installed rubygems files and issue is resolved.
$ which ruby
/Users/Reza/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby
$ echo $MY_RUBY_HOME
/Users/Reza/.rvm/rubies/ruby-1.9.2-rc2
$ cd "$MY_RUBY_HOME/lib/ruby/site_ruby/1.9.1/"
$ mv rubygems.rb rubygems.rb-rename
$ mv rubygems rubygems-rename
$ bundle -v
Bundler version 1.0.18
Try to manually update to the latest RubyGems version from here:
http://rubygems.org/pages/download
1. Download the latest rubygems
http://production.cf.rubygems.org/rubygems/rubygems-1.8.7.tgz
2. Extract it
tar zxvf rubygems-1.8.7.tgz
3. Install it
cd rubygems-1.8.7
sudo ruby setup.rb
If that does not help you can try and download an older version of rubygems from here:
http://rubyforge.org/frs/?group_id=126
For example 1.8.5, 1.8.0, 1.7.0, 1.6.0.
精彩评论