rails assets:预编译系统中未检测到Yarn可执行文件

Fab*_*lio 6 linux ubuntu ruby-on-rails yarnpkg

我正在使用基于Ubunt 17.04的Linux 18.当我跑步时,rails assets:precompile我得到以下消息Yarn executable was not detected in the system

当我按照本帖子网页上的安装说明进行操作时,我成功安装了Yarn,但rails一直给我错误

我注意到node.js有Linux Mint的系统包到版本17.2,我试图对Yarn页面执行所有指令并手动安装node.js已安装在我的系统中.

该消息并不能解释问题.如果我运行yarn --help它是有效的,我的yarn --version0.22

这是我的Linux Mint系统

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18
DISTRIB_CODENAME=sarah
DISTRIB_DESCRIPTION="Linux Mint 18 Sarah"
NAME="Ubuntu"
VERSION="16.04 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
cat: /etc/upstream-release: Is a directory
Run Code Online (Sandbox Code Playgroud)

更新

这是我$PATH在终端中回显的输出/opt/yarn-0.22/bin,但当我走到那条路径时,没有文件夹,/opt/yarn-0.22所以我需要了解它的安装位置并正确配置PATH SETUP

Path Setup

If you chose manual installation, the following steps will add Yarn to path variable and run it from anywhere.

Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.

Add this to your profile: export PATH="$PATH:/opt/yarn-[version]/bin" (the path may vary depending on where you extracted Yarn to)
In the terminal, log in and log out for the changes to take effect
To have access to Yarn’s executables globally, you will need to set up the PATH environment variable in your terminal. To do this, add export PATH="$PATH:`yarn global bin`" to your profile.
Run Code Online (Sandbox Code Playgroud)

非常感谢最好的问候Fabrizio Bertoglio

uza*_*aif 18

纱线是节点包经理纱线

你必须在这里安装它instrauction 安装指南 如果你有节点和npm你可以通过它安装它

npm install yarn -g


如果您npm的机器没有,请转到 此链接并安装node也将安装npm


如果您想像那样管理多个版本节点,RVM则需要签出此链接