Spree install undefined method mass_assignment_sanitizer

I looked at this problem in the list of questions, but nothing helped. This is my first stackoverflow question, so please accept my apologies if I do something wrong. In addition, I still have a lot of English for improvement.

I install Spree following github instructions

$ gem install spree $ rails new my_store $ spree install my_store 

when i get this message

...

 Admin Password [spree123] gemfile spree gemfile spree_usa_epay gemfile spree_skrill run bundle install from "./my_store" git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install` precompiling assets git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install` 

... Well, as indicated in the manual, in case of problems with circular addiction:

 $ gem install spree_cmd $spree install my_store -A gemfile spree gemfile spree_usa_epay gemfile spree_skrill run bundle install from "./my_store" git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install` precompiling assets git://github.com/spree/spree_usa_epay.git (at 0cb57b4) is not checked out. Please run `bundle install` 

I replaced the directory with the application and ran the command:

 $cd my_store $bundle install 

and I get the following error:

 Bundler could not find compatible versions for gem "rails": In Gemfile: spree_usa_epay (>= 0) ruby depends on rails (<= 3.1.3, >= 3.1.1) ruby rails (3.2.1) 

after that I changed the gem file to work with rails 3.1.3 and coffeescript gems and repeated the whole process again, and I realized that.

 Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord- 3.1.3/lib/active_record/base.rb:1088:in `method_missing': undefined method `mass_assignment_sanitizer=' for ActiveRecord::Base:Class (NoMethodError) from /Users/Snake/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.3/lib/active_record/railtie.rb:59:in `block (3 levels) in <class:Railtie>' 

He thinks this might be something with the rails version, but I don't know to get started.

Has anyone had this problem before?

I am running Mac OS X 10.5.8

rails 3.2.1

ruby 1.9.3p0 (2011-10-30 version 33570) [i386-darwin9.8.0]

ImageMagick @ 6.7.4-6_0 + q16

+4
source share
2 answers

As @Anatoly Ruchka suggested that the problem was using rails 3.2.1, so I switched to 3.1.3.

Here's what I did, I found a @vonconrad post where I explained how to create a rail project without touching the installation.

1) I create a directory folder for my project:

 $mkdir old_rails313 $cd old_rails313 $touch gemfile $nano gemfile 

2) I inserted the gemfile definition, indicating that you are specifying the version of the relays that I want, so it looks like

 source 'http://rubygems.org' gem 'rails', '3.1.3' gem 'sqlite3' group :assets do gem 'sass-rails', '~> 3.1.5' gem 'coffee-rails', '~> 3.1.1' gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' gem "rspec-rails", ">= 2.8.0.rc1", :group => [:development, :test] gem "factory_girl_rails", ">= 1.4.0", :group => :test gem "cucumber-rails", ">= 1.2.0", :group => :test gem "capybara", ">= 1.1.2", :group => :test gem "database_cleaner", ">= 0.7.0", :group => :test gem "launchy", ">= 2.0.5", :group => :test #gem "devise", ">= 1.5.0" gem 'spree','1.0.0' 

3), then I run

 bundle install bundle exec rails new . rails g spree:install rails s 

After installation, I have a conflict with gem 'spree', '1.0.0', so I will comment on this.

I also have a warning, but it works:

 [DEPRECATION WARNING] Nested I18n namespace lookup under "activerecord.attributes.spree/order" is no longer supported 

thanks a lot

+3
source

I think you should use rails version 3.1.3 for spree_usa_epay

To do this, you must remove all the rails that you have on the machine.

observe usage

 gem list -d rails 

than

 sudo gem uninstall rails -v ... 

and create a new project with

 rails new my_store 

how to edit gemfile and paste

gem 'spree', '1.0.0'

and

 bundle install 

well done

 rails server 
0
source

Source: https://habr.com/ru/post/1395835/


All Articles