huacnlee / rails-settings-cached

Global settings for your Rails application.
Other
1.06k stars 202 forks source link

(Fix) Ruby 2.5.1 Rails 5.2.1 undefined method `x' for #<Class:0x00007ff764e45260> #151

Closed 1c7 closed 5 years ago

1c7 commented 5 years ago

Hi, this is a error report (I am using Homeland(ruby-china), developing some new feature) image under Ruby 2.5.1 + Rails 5.2.1 Setting model seem like doesn't work. I can't track down what exactly is the problem but

This fixed my issue.

config/enviroment/development.rb

config.cache_store = :null_store

I post here just in case someone else got same issue and need a quick fix

I don't know why it work, but it work for now. I would read more about cache_store later.

Version

image

bundle show | grep rails-settings-cached

0.7.2

ruby -v

2.5.1

rails -v

5.2.1

1c7 commented 5 years ago

我发英文是为了能让更多人看懂,我不确定为什么 Setting 就突然出问题了。 我用 rails new test 之类的新建一个项目,然后在新项目里只弄 rails-settings-cached,一切正常。 但是在 Homeland 里面就会出错。

config.cache_store = :null_store 是我在 rails new 新项目里 config/enviroment/development.rb 看到的设置。 我直接 copy 过来就管用了

1c7 commented 5 years ago

image 显然这不是一个好的方案。 https://guides.rubyonrails.org/caching_with_rails.html 只是临时 fix

1c7 commented 5 years ago

image this work too

1c7 commented 5 years ago

此问题可随时关闭