6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rails4 rails_config から config へ変更する

Last updated at Posted at 2015-09-12

rails_config が config ( https://github.com/railsconfig/config/ ) という gem 名に変わりました。
変更するためには、若干のソース修正が必要です。

参考

変更手順

Gemfile の変更

rails_config を config に変更します。
変更後 bundle install します。

Gemfile
# gem "rails_config"
gem "config"

RailsConfig から Config を利用するように変更

config/initializers/rails_config.rb を config/initializers/config.rb へリネームします。

そのあとクラス名を Config に変更します。

config/initializers/config.rb
# RailsConfig.setup do |config|
Config.setup do |config|
  config.const_name = "Settings"
end

以上で変更は完了です。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?