导轨。宝石捆绑失败

发布于 2024-11-28 09:57:09 字数 2176 浏览 0 评论 0原文

我跑后:

捆绑安装

我得到:

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:14:in Gem::QuickLoader:Module 的“:未定义方法删除” (NoMethodError) 来自 :158:in require' 来自 <内部:gem_prelude>:158:inload_full_rubygems_library'来自 :280:在 method_missing' 中 /usr/local/bin/bundle:19:in' mat@Macbook-Pro~/Documents/workspace/RoR/rails_projects/sample_app$

编辑:

>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>'

我的 Gemfile 是:

>

 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 for 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

有人可以帮助我吗?谢谢!

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:in require' from
<internal:gem_prelude>:158:in
load_full_rubygems_library' from
:280:in method_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 for 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

难以启齿的温柔 2024-12-05 09:57:09

我遇到了类似的错误:

$ 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)

似乎所有 [..]/rubygems.rb Undefined method[..] 问题都与已安装的 ruby​​gems(例如通过 rvm ruby​​gems)和内置的冲突有关ruby 1.9.x 中的 ruby​​gems 方法

只需重命名已安装的 ruby​​gems 文件即可解决问题。

$ 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

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
弄潮 2024-12-05 09:57:09

尝试从此处手动更新到最新的 RubyGems 版本:

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

如果这没有帮助,您可以尝试从这里下载旧版本的 ruby​​gems:
http://rubyforge.org/frs/?group_id=126

例如 1.8.5, 1.8.0、1.7.0、1.6.0。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文