已有的项目日志输出在 STDOUT,方便一些日志工具汇总日志,现在想增加其他的日志分享工具却又需要从文件中读取日志,如何在保持日志输出到STDOUT的同时增加输出到文件中呢?
https://guides.rubyonrails.org/initialization.html#rails-server-start
已有的项目日志输出在 STDOUT,方便一些日志工具汇总日志,现在想增加其他的日志分享工具却又需要从文件中读取日志,如何在保持日志输出到STDOUT的同时增加输出到文件中呢?
https://guides.rubyonrails.org/initialization.html#rails-server-start
.yarnrc
我们需要在 Rails 项目根目录配置 .yarnrc
告诉 Yarn 我们需要将 npm 的包缓存到 vendor/cache/npm
目录。
registry "https://registry.npm.taobao.org"
lastUpdateCheck 1561690751463
yarn-offline-mirror "./vendor/cache/npm"
yarn-offline-mirror-pruning true
sudo chown -R $(whoami) $(brew --prefix)/* |
使用 Genymotion 作为 Android Emulator 时,本地调用 Rails 作为 API 后台的 IP 地址,
应该使用 10.0.3.2 来代替 localhost
同时,Rails 服务启动的时候需要使用
rails s -b 0.0.0.0
使用 Android Emulator 相当于是局域网里的另一台机器来访问 Rails 服务,而在 Rails 4.2 以后修改了 Rails Server 默认的的 Host, 所以要使用上面的命令来让 Android Emulator 可以访问 Rails Service,同时需要注意使用防火墙策略来只让受信任的机器访问你的开发服务器。
# ~/.bash_profile | |
function cd { | |
# actually change the directory with all args passed to the function | |
builtin cd "$@" | |
auto_set_tab_chrome_background_color; | |
} | |
function auto_set_tab_chrome_background_color { |
class Play < ActiveRecord::Base | |
# 先告诉model我们在体育协会有很多笔资料 | |
has_many :sports_associations | |
# 这些资料是要拿来判断这个球员有参与多少球队 | |
has_many :teams, :through => :sports_associations | |
end |