Spree installation doesn't work. Getting error: undefined method `add_module 'for Devise: Module (NoMethodError)

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

By the way, I already have it gem 'devise-encryptable'

in my Gemfile.

when i'm cd

in 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 to fix it? I am using the latest version of both rails and fun. the development version I installed isdevise-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'

      

+3


source to share


3 answers


Try to post this line gem 'devise-encryptable'



at the bottom of the Gemfile. This posed the problem for me. Probably the crafted gem finds an old version of Devise that doesn't have the Devise.add_module method.

+9


source


I ran into this error just now and got a solution. You need to open the file lib/devise-encryptable.rb

in a gem catalog and add this line at the beginning: require 'devise'

. And don't forget to follow these tips . Enjoy.



+1


source


Remove gem 'devise-encryptable'

from your Gemfile as it is already listed as a dependency in the spree_auth_devise

gem. What's going on here is that this gem is loaded in front of the gem devise

, so your application breaks.

0


source







All Articles