@ywjno 你在 win 下 gem install kgio 试试,能安装@我
@Rei 还有你代码注释的引号怎么打的?我总是复制你的,```ruby 前面是不是引号?
@Rei 谢谢你中下水平的 Rails 程序员,问题已经解决了。
class Email < ActiveRecord::Base
attr_accessible :to, :from, :mail
end
自己打补丁后报的错。
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
D:/railsdemo/config/initializers/ar_mailer_rails3.rb:3:in `<class:A
ctiveRecord>': undefined method `attr_accessible' for ArMailerRails3::ActiveReco
rd:Class (NoMethodError)
from D:/railsdemo/config/initializers/ar_mailer_rails3.rb:2
:in `<module:ArMailerRails3>'
from D:/railsdemo/config/initializers/ar_mailer_rails3.rb:1
:in `<top (required)>'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:245:in `load'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:245:in `block in load'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:236:in `load_dependency'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:245:in `load'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/engine
.rb:588:in `block (2 levels) in <class:Engine>'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/engine
.rb:587:in `each'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/engine
.rb:587:in `block in <class:Engine>'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/initia
lizable.rb:30:in `instance_exec'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/initia
lizable.rb:30:in `run'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/initia
lizable.rb:55:in `block in run_initializers'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/initia
lizable.rb:54:in `each'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/initia
lizable.rb:54:in `run_initializers'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/applic
ation.rb:136:in `initialize!'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/railti
e/configurable.rb:30:in `method_missing'
from D:/railsdemo/config/environment.rb:5:in `<top (require
d)>'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:251:in `require'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:251:in `block in require'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:236:in `load_dependency'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.5/lib/active_
support/dependencies.rb:251:in `require'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/applic
ation.rb:103:in `require_environment!'
from D:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.5/lib/rails/comman
ds.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ar_mailer_rails3 是把要发的邮件,都存到数据库中。然后我执行一下就异步发出去了。 ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes: mail, to, from 不知道如何把这几个属性,添加到白名单去。我看别人的源码,也没在 mailers 里面做啥处理啊。
class UserMailer < ActionMailer::Base
default from: "[email protected]"
def test
mail(:to => "[email protected]",:body => "Have a good day!", :subject => "test mail")
end
end
@raven 好的,去 stackoverflow 看看去。
活动一般有多少人参加呢?
@ywjno win 下面开发,rails 跑起来慢,你是新手所以没遇到不能用的 gem。我歧视两种人,一种是新手,一种是歧视新手的人。
主要是 win 下面开发,确实有很多的问题。首页除了热门帖子,也可以显示新手帖子。
这个:mail,:to,:from 是 mailers 里面的,不是 models 里面,不知道去哪里写?
高手,你为什么不解答下新手的问题,到瞎扯淡专区发言?
代码里应该如何写,才能行?不想 config.active_record.whitelist_attributes = false
活动组织了以后,最后在社区有一个总结。
谢谢华顺,那我不瞎折腾了。
欢迎赞助 Air 一台,请直接发邮件密我哦。。。
Microsoft Windows XP 版本 5.1.2600 版权所有 1985-2001 Microsoft Corp.
D:\Code>gem install rmagick
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Building YARD (yri) index for rmagick-2.13.1...
[error]: Unhandled exception in YARD::Handlers::C::MixinHandler:
[error]: in ext/RMagick/rmmain.c
:611:
611: rb_include_module(Class_Pixel, observable);
[error]: ArgumentError: NilClass is not a valid CodeObject
[error]: Stack trace:
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/code_objects/bas
e.rb:23:in push'
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/handlers/c/mixin
_handler.rb:10:in
block (2 levels) in class:MixinHandler'
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/handlers/c/mixin
_handler.rb:7:in scan'
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/handlers/c/mixin
_handler.rb:7:in
block in class:MixinHandler'
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/handlers/process
or.rb:114:in block (2 levels) in process'
D:/Ruby193/lib/ruby/gems/1.9.1/gems/yard-0.8.1/lib/yard/handlers/process
or.rb:112:in
each'
Installing RDoc documentation for rmagick-2.13.1...
恩,看到了,只是我下载的 ImageMagick 怎么没有 include 和 lib 目录? 我下载的是 ImageMagick-6.7.6-9-Q16-windows-dll.exe
有木有个对比图?
自己回复下 读写权限:公共读权限
谁?
怎么解决这个问题?
大家水平菜,还没开始玩呢?只是注册下,具体怎么玩还不知道呢。
这个会不会太粗浅了?
是不是执行下 bundle exec rake assets:precompile 就可以? 还是要修改很多配置?能不能简单说下要处理的地方。
昨天去下载下来,确实很大。第一次听华顺现场教学,很不错。羡慕他的本子
win 下开发,也可以,只是运行起来慢了点。不很爽罢了。
关键我觉得必须还得有用盛大云的人帮你反向代理才行,不仅仅是域名的问题。
华顺帮我代理了一下,确实可以用。