rails error method_missing':未定义的方法`this'用于Gem :: Specification

时间:2016-02-22 08:55:58

标签: ruby-on-rails ruby

我遵循本教程: https://guides.spreecommerce.com/developer/getting_started_tutorial.html#installing-image-magick 我写的时候

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

我明白了:

/home/jonstark/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in
`method_missing': undefined method `this' for
#<Gem::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
`<top (required)>'  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
`<top (required)>'  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
`<top (required)>'  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
`<top (required)>'  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 `<main>'    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
`<main>'

我的宝石文件

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

更新: 我在这里创建了一个github问题https://github.com/spree/spree/issues/7104 他们把我和这里联系起来 https://github.com/rubygems/rubygems/issues/1420

但我仍然不知道如何解决我的问题

3 个答案:

答案 0 :(得分:24)

gem update --system 2.4.8 --no-ri --no-rdoc - 修复了它 细节在这里 https://github.com/remomueller/documentation/issues/7

答案 1 :(得分:15)

这是RubyGems 2.5.1中的一个问题,并在RubyGems 2.6.3中修复了

只需将RubyGems更新到2.6.3或更高版本。

gem update --system 2.6.3

或者如果您使用RVM (来自alf&#39)

rvm rubygems 2.6.3

答案 2 :(得分:0)

从Ruby 2.3.0降级到2.2.0为我修复了