前言 这是一个很有用的命令,可以用来监看命令的执行结果。更重要的是,它是系统提供的,所以可以跟各种编程语言和命令组合在一起。 环境 OS: Linux 参数 这里只列举常用的几个参数 -n: 间隔时间 -d: 高亮变化的…
Ruby On Rails 7 提示`Redis.current=`将被废弃
环境 ruby: 3.1.1 Ruby On Rails: 7.0.2.3 redis-rb: 4.6 问题 在config/initializers/redis.rb中定义 redis 的配置后,提示如下信息 `Red…
Rails 中的 config.force_ssl = true 的作用
引言 在config/environments/production.rb配置文件中有这么一行配置(默认没有开启) config.force_ssl = true 作用 将 http 的请求重定向到 https 设置 c…
Teamviewer 设备达到限制,移除旧设备的方法
因为重装了系统,旧的系统的 teamviewer 没有移除登录,在新的系统登录时,teamviewer 提示设备达到限制了,这里介绍下移除设备的方法 登录 https://login.teamviewer.com/Log…
Manjaro 21.2 i3wm 安装搜狗输入法
环境 Manjaro: 21.2rc WM: i3wm 安装 sudo pacman -S fcitx-im sudo pacman -S fcitx-configtool sudo pacman -S fcitx-so…
Linux Manjaro 21.2.0 使用多核压缩文件
环境 Manjaro: 21.2.0 方法 使用tar命令的-I或者--use-compress-program参数,配合pigz(gzip)或pbzip2(bzip2)使用 安装 pigz 和 pbzip2 $ sud…
Rails Gem 创建 generator
环境 Rails: 6.1.4.1 Ruby: 3.0.1 Manjaro 21.1.5 引文 因为使用 rails plugin new gem_name 创建的 gem 是不带有 rails 命令的,没办法直接生成 …
Rails 6 API 模式使用 JBuilder
环境 Rails: 6.1.4.1 Ruby: 3.1 TL;DR 在 Gemfile 中打开 jbuilder 的注释,然后执行 bundle install 即可 步骤 新建Rails应用 $ rails new d…
Vagrant 启动 ubuntu 20.04 时报错,mount /vagrant file 失败
环境 OS: Manjaro-21.1.0 Vagrant: 2.2.16 报错信息 Vagrant was unable to mount VirtualBox shared folders. This is usua…
Rails 小技巧(三) - 使用 fetch 获取 Hash 和 Array 中的值
环境 Ruby: 3.0.1 Ruby On Rails: 6.1.4 什么是 fetch 下面是Rubydoc关于 fetch 的描述 fetch 的作用是从 hash 中获取给定的 key 对应的值。如果没有找到该 …