How should I define application-specific configuration information?
I got an error when I created my_config.yml under /config and my_config.rb under /config/initializers.The contents of each file are as follows:
my_config.yml:
COMMON:&COMMON
author: "user name"
logo:
source: "http://www.wings.msn.to/image/wings.jpg"
width:215
height —67
development:
hoge: "dev"
<<:*COMMON
test:
hoge: "test"
<<:*COMMON
production:
hoge: "pro"
<<:*COMMON
my_config.rb:
MY_APP=YAML.load(File.read("/Users/****/rails_projects/third_app/config/my_config.yml")[Rails.env]
# ****** is the username
RailsConfig allows you to read and use configuration information from a YAML file.The configuration can also be set separately for each RAILS_ENV (development, production, test, ...).
There is Settingslogic in a similar gem, but it hasn't been updated for about a year, so you might want to avoid it.
620 Uncaught (inpromise) Error on Electron: An object could not be cloned
917 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
582 PHP ssh2_scp_send fails to send files as intended
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.