zsh

Rails keeps telling me that it's not currently installed

假装没事ソ 提交于 2019-11-26 18:19:46
I use rvm to manage different rubies and their gemsets. My shell is zsh with oh-my-zsh configured with basic settings. Enabled oh-my-zsh plugins are ruby, rails, osx, and git. Here's the command I used to install ruby-1.8.7 and rails-3.0.7. rvm install 1.8.7 rvm use 1.8.7 gem install rails -v=3.0.7 and then I typed rails and got: Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun your "rails" command. I've tried more thorough installs also, Like reinstall rubygems after switching to ruby-1.8.7, or create a

Ubuntu笔记

我怕爱的太早我们不能终老 提交于 2019-11-26 17:20:39
Ubuntu笔记 Ubuntu使用过程中整理的一些常用或关键操作整理,以备不时之需, 另外自己可以对界面做一些美化,这部分自行百度去配置,我的界面如图 ##################Ubuntu18.04版########################### 1.########################换源############################## 1) 备份默认的apt源 1 $ cd /etc/apt 2 $ sudo cp sources.list sources.list.backup 2) 编辑 $ sudo gedit sources.list 复制粘贴以下列表: deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com

How can I format the output of a bash command in neat columns

纵饮孤独 提交于 2019-11-26 15:22:10
问题 I have a function which outputs many rows of information which I want to format in columns. The problem is that the width of any particular "cell" (if I may use that term) of data is variable, so piping it to something like awk does not give me what I want. The function is "keys" (not that it matters) and I'm trying something like this: $ keys | awk '{ print $1"\t\t" $2 }' but the output (a snippet of it, that is) looks like this: "option-y" yank-pop "option-z" execute-last-named-cmd "option-

Manjaro 安装后的配置

有些话、适合烂在心里 提交于 2019-11-26 14:59:17
1. 将本地数据包与远程数据包同步 sudo pacman -Syy 默认manjaro是没有同步数据包的,也就是说,这个时候你执行 pacman -S pack_name 会报数据包找不到的错误( warning: database file for 'core' does not exist ...) 2. 安装vim vim 无疑是linux下最好用的编辑器之一,为了方便我们待会修改配置文件,可以先将这个软件装上 sudo pacman -S vim 如果我们没有执行第一步操作,这个时候直接安装是会报错的 3. 添加archlinxCN源 用vim编辑 /etc/pacman.conf 文件( sudo vim /etc/pacman.conf ),在文件底部添加下面几行: [archlinuxcn] SigLevel = Optional TrustedOnly Server =https://mirrors.ustc.edu.cn/archlinuxcn/$arch 修改配置文件后,执行下面的命令: sudo pacman -Syy && sudo pacman -S archlinuxcn-keyring 4. 安装ZSH ZSH可以说是shell中的极品,它的优点太多了,我就不一一写出来,有兴趣的同学可以看这篇文章 知乎-为什么说zsh是shell中的极品

Windows 安装和配置 WSL

六月ゝ 毕业季﹏ 提交于 2019-11-26 13:44:56
Windows 安装和配置 WSL 什么是 WSL 引用百度百科的一段话: Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。它是由微软与Canonical公司合作开发,目标是使纯正的Ubuntu 14.04 "Trusty Tahr"映像能下载和解压到用户的本地计算机,并且映像内的工具和实用工具能在此子系统上原生运行。 我们简单的认为它是在 Windows 上安装了一个 Linux 环境就好了。也就是最好的 Linux 发行版:Win10 + WSL (滑稽)。 安装 WSL 1. 启用或关闭Windows功能 首先在搜索栏中搜索并打开“启用或关闭Windows功能”,勾选“适用于Linux的Windows子系统”项。只有开启这项设置才能正常安装WSL。 2. 安装 WSL 在微软应用商店搜索 Linux,可以看到一系列 Linux 发行版,根据自己需要选择适合自己的发行版,这里我选用 Ubuntu 18.04 LTS,下载完成后启动,等待安装完成,输入账户和密码,我们便得到了一个 Linux 环境了。 3. WSL 文件位置 如果想在 Linux 查看其他分区,WSL 将其它盘符挂载在 /mnt 下。 如果想在 Windows 下查看 WSL 文件位置,文件位置在:

Where to place $PATH variable assertions in zsh?

社会主义新天地 提交于 2019-11-26 11:47:49
问题 I love zsh , but I am not sure where to place my $PATH and other variable assertions? I find that they are scattered between the files .zshrc .zprofile .bashrc .bash_profile , and sometimes doubled. I realize that having anything inside the bash files doesn\'t make much sense seeing as I\'m using zsh , but where exactly should I be placing my rvm , python , node etc additions to my $PATH ? Is there a specific file I should be using (i.e. .zshenv which does not currently exist in my

bash command not found when setting a variable

泄露秘密 提交于 2019-11-26 11:43:14
问题 I am writing a shell script where I am setting few variables, whose value is the output of commands. The errors I get are: $ $tag_name=\"proddeploy-$(date +\"%Y%m%d_%H%M\")\" -bash: =proddeploy-20141003_0500: command not found now, I did read other similar questions and based on it, I tried various things: spliting command into two calls $ $deploy_date=date +\"%Y%m%d_%H%M\" bash: =date: command not found $ $tag_name=\"proddeploy-$deploy_date\" bash: proddeploy- command not found tried using

How to merge two arrays in a zipper like fashion in Bash?

五迷三道 提交于 2019-11-26 11:37:59
问题 I am trying to merge two arrays into one in a zipper like fashion. I have difficulty to make that happen. array1=(one three five seven) array2=(two four six eight) I have tried with nested for-loops but can\'t figure it out. I don\'t want the output to be 13572468 but 12345678. The actual script I am working on is here (http://ix.io/iZR).. but it is obviously not working as intended. I either get the whole of array2 printed (ex. 124683) or just the first index like if the loop didn\'t work

Ubuntu18个人使用笔记整理

本秂侑毒 提交于 2019-11-26 10:33:25
Ubuntu使用过程中整理的一些常用或关键操作整理,以备不时之需, 另外自己可以对界面做一些美化,这部分自行百度去配置,我的界面如图 ##################Ubuntu18.04版########################### 1.########################换源############################## 1) 备份默认的apt源 1 $ cd /etc/apt 2 $ sudo cp sources.list sources.list.backup 2) 编辑 $ sudo gedit sources.list 复制粘贴以下列表: deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/