rails error method_missing': undefined method `this' for Gem::Specification

匿名 (未验证) 提交于 2019-12-03 01:25:01

问题:

I follow this tutorial: https://guides.spreecommerce.com/developer/getting_started_tutorial.html#installing-image-magick When I write

jonstark@jonstark-pc:~/rails_projects/optima1$ spree install --auto-accept 

I got this:

/home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<:specification:0x4db6d12 activesupport-4.2.0=""> (NoMethodError)     from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'  from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'   from /home/jonstark/.rvm/gems/ruby-2.3.0/gems/activesupport-4.2.0/lib/active_support/core_ext/string.rb:1:in `'  from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'   from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'     from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'   from /home/jonstark/.rvm/gems/ruby-2.3.0/gems/spree_cmd-3.0.6.1/lib/spree_cmd/installer.rb:2:in `'  from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'   from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'   from /home/jonstark/.rvm/gems/ruby-2.3.0/gems/spree_cmd-3.0.6.1/lib/spree_cmd.rb:13:in `'  from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'   from /home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'   from /home/jonstark/.rvm/gems/ruby-2.3.0/gems/spree_cmd-3.0.6.1/bin/spree:2:in `'  from /home/jonstark/.rvm/gems/ruby-2.3.0/bin/spree:23:in `load'  from /home/jonstark/.rvm/gems/ruby-2.3.0/bin/spree:23:in `
' from /home/jonstark/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval' from /home/jonstark/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `
'

My gemfile

source 'https://rubygems.org' ruby '2.3.0' #ruby-gemset=railstutorial_rails_4_0  gem 'rails', '4.2' gem 'bootstrap-sass' gem 'sprockets' gem 'bcrypt-ruby' gem 'faker' gem 'will_paginate' gem 'bootstrap-will_paginate' gem 'ffaker' gem 'carrierwave', '~> 0.9' gem "font-awesome-rails" gem 'sprockets-rails' gem 'rest-client' gem 'blogo' gem 'fog' gem 'carrierwave-aws' gem "figaro"  group :development, :test do   gem 'sqlite3'   gem 'rspec-rails' end  group :test do   gem 'selenium-webdriver'   gem 'capybara'   gem 'factory_girl_rails'  end   gem 'sass-rails' gem 'uglifier' gem 'coffee-rails' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder'  group :doc do   gem 'sdoc', '0.3.20', require: false end  group :production do   gem 'pg'   gem 'rails_12factor'   gem 'heroku-deflater'  # gem 'unicorn' end 

UPDATE: I created a github issue here https://github.com/spree/spree/issues/7104 and they linked me to here https://github.com/rubygems/rubygems/issues/1420

But I still don't know how to solve my problem

回答1:

gem update --system 2.4.8 --no-ri --no-rdoc - fixed it details are here https://github.com/remomueller/documentation/issues/7



回答2:

This was an issue in RubyGems 2.5.1 and it is fixed in RubyGems 2.6.3

Just update RubyGems to version 2.6.3 or greater.

gem update --system 2.6.3 

Or if you use RVM (From alf's comment)

rvm rubygems 2.6.3 


回答3:

Downgrading from Ruby 2.3.0 to 2.2.0 fixed it for me



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!