3

I am following basic instructions mentioned here: http://guides.spreecommerce.com/getting_started.html

BTW I already have gem 'devise-encryptable' in my Gemfile.

when I cd into mystore and try to run spree install, this is the error I get:

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-encryptable-0.1.1/lib/devise/encryptable/encryptable.rb:28:in `<top (required)>': undefined method `add_module' for Devise:Module (NoMethodError)
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-encryptable-0.1.1/lib/devise-encryptable.rb:1:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/devise-encryptable-0.1.1/lib/devise-encryptable.rb:1:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
    from /Users/amiterandole/Desktop/current/rails/mystore/config/application.rb:7:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'
    from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.11/lib/rails/commands.rb:24:in `<top (required)>'
    from script/rails:6:in `require'
from script/rails:6:in `<main>'

what is happening and how do I fix it? I happen to be using the latest version of both rails and spree. the devise version I have installed is devise-2.2.2

UPDATE: here is my gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.11'

gem 'pg'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'devise-encryptable'

# To use debugger
# gem 'debugger'
gem 'spree', '1.3.1'
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '1-3-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'
4

3 に答える 3

9

この行を配置してみてください gem 'devise-encryptable'

Gemfile の一番下にあります。これで問題は解決しました。おそらく、devise-encryptable gem は、Devise.add_module メソッドを持たない古いバージョンの Devise を見つけます。

于 2013-01-23T18:19:58.750 に答える
1

私は今このエラーに遭遇しましたが、解決策があります。lib/devise-encryptable.rbgem のディレクトリでファイルを開き、先頭に次の行を追加する必要があります: require 'devise'. そして、このアドバイスに従うことを忘れないでください。楽しみ。

于 2013-01-24T18:33:38.120 に答える
0

gem 'devise-encryptable'gemで依存関係として既に指定されているため、Gemfile から削除しますspree_auth_devise。ここで起こっていることは、この gem がdevisegem より前にロードされているということです。これが、アプリケーションが壊れている理由です。

于 2013-01-23T19:44:11.240 に答える