疯狂安装未定义的方法mass_assignment_sanitizer

发布于 2025-01-04 02:19:59 字数 2042 浏览 1 评论 0原文

我在问题列表中查看了这个问题,但没有任何帮助。 这是我在 stackoverflow 中的第一个问题,所以如果我做错了什么,请接受我的道歉。而且我的英语还有很多需要提高。

我正在按照 github 说明安装 Spree

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

当我收到此消息时

......

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`

, 好吧,正如指南所建议的,如果出现循环依赖问题,请执行以下操作:

$ 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`

我将目录更改为应用程序并运行命令:

$cd my_store

$bundle install 

收到以下错误

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)

在此之后我更改了 gem 文件以使用 Rails 3.1.3 和 Coffeescript Gems 并 再次重复整个过程,我明白了。

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>'

它认为这可能是 Rails 版本的狂欢,但我不知道要开始。

以前有人遇到过这个问题吗?

我运行 Mac OS X 10.5.8

Rails 3.2.1

ruby​​ 1.9.3p0 (2011-10-30 修订版 33570) [i386-darwin9.8.0]

ImageMagick @6.7.4-6_0+q16

I took a look about this problem within the list of question but nothing helped.
This is my first question in stackoverflow so please accept my apologies in case I do something wrong. Also I still have a lot of english to improve.

I'm installing Spree following the 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 the guide suggests, in case of circular dependency issues do:

$ 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 changed directory to the app and run 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 this I changed the gem file to work with rails 3.1.3 and coffeescript gems and repeat the whole process again and I get this.

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>'

It think it might be something with version of rails a spree but I don't know were to start.

Does anybody had this issue before?

I running Mac OS X 10.5.8

rails 3.2.1

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

ImageMagick @6.7.4-6_0+q16

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小糖芽 2025-01-11 02:20:00

正如@Anatoly Ruchka 所建议的,问题是使用rails 3.2.1,所以我切换到3.1.3。

这就是我所做的,我找到了 @vonconrad 的帖子,他解释了如何在不接触安装的情况下创建铁路项目。

1)我为我的项目创建一个目录文件夹:

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

2)
我粘贴了一个 gemfile 定义,指定了您提到的我想要的 Rails 版本,所以它看起来像这样

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) 然后我运行

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

安装后我与 gem 'spree'、'1.0.0' 发生冲突,所以我评论它出来了。

我也收到了警告,但它有效:

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

非常感谢

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

This is what I did, I found a post of @vonconrad where he explain how to create a rail project without touch the installation.

1) I create a directory folder for my project:

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

2)
I pasted a gemfile definition specifying as you mention the version of rails I want, so it looks like this

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 installing I've got a conflict with the gem 'spree','1.0.0', so I comment it out.

Also I've got a warning but it works:

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

Thanks a lot

半仙 2025-01-11 02:20:00

我认为你应该使用 Rails 版本 3.1.3 来 spree_usa_epay

这样做,你应该卸载机器上所有

要观看使用的

gem list -d rails

Rails ,

sudo gem uninstall rails -v ...

创建新项目

rails new my_store

然后使用编辑 Gemfile 并粘贴

gem 'spree'、'1.0.0'

bundle install

干得好

rails server

I think you should use rails version 3.1.3 for spree_usa_epay

TO do that you should uninstall all rails what you have on machine

to watch use

gem list -d rails

than

sudo gem uninstall rails -v ...

and create new project with

rails new my_store

than edit Gemfile and paste

gem 'spree', '1.0.0'

and

bundle install

well done

rails server
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文