这不是先前提出的关于同一主题的问题的重复。 我的Rails版本是3.1.1,Ruby版本是1.9.3 我有一个模型类
class TestDistance < ActiveRecord::Base
def self.yo
puts "yo"
end
end
如果我按以下方式更改方法
class TestDistance&lt;的ActiveRecord ::基
def self.yo
puts "yo yo"
end
end
reload!;TestDistance.yo
未反映更改
运行rails c
时,控制台日志如下所示Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub rails` to work around a system/bundle conflict.
You did not specify how you would like Rails to report deprecation notices for your development environment, please set config.active_support.deprecation to :log at config/environments/development.rb
Unsupported version: 2.1.9
For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
[DEVISE] To select a encryption which isn't bcrypt, you should use devise-encryptable gem.
SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
This poses a security threat. It is strongly recommended that you
provide a secret to prevent exploits that may be possible from crafted
cookies. This will not be supported in future versions of Rack, and
future versions will even invalidate your existing user cookies.
Called from: /home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.1.0/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/rack-mount-0.8.3/lib/rack/mount/strexp.rb:41: warning: redundant nested repeat operator
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.1.0/lib/action_dispatch/routing/route.rb:37: warning: redundant nested repeat operator
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/rack-mount-0.8.3/lib/rack/mount/route.rb:46: warning: redundant nested repeat operator
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require': iconv will be deprecated in the future, use String#encode instead.
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/rack-mount-0.8.3/lib/rack/mount/strexp.rb:41: warning: redundant nested repeat operator
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/actionpack-3.1.0/lib/action_dispatch/routing/route.rb:37: warning: redundant nested repeat operator
/home/ankit/.rvm/gems/ruby-1.9.3-p547/gems/rack-mount-0.8.3/lib/rack/mount/route.rb:46: warning: redundant nested repeat operator
Loading development environment (Rails 3.1.0)