本文介绍了Rails资产:未在系统中检测到预编译Yarn可执行文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using Linux 18 based on Ubunt 17.04.When I run rails assets:precompile I get the following message Yarn executable was not detected in the system

当我按照此帖子中的说明进行安装时,或在网页上,我成功安装了Yarn,但是rails不断给我错误

When I follow the instruction for the installation like in this Post or on the Webpage, I install Yarn successfully, but rails keeps giving me the error

我注意到 node.js 具有最高版本为17.2的Linux Mint的系统软件包,我尝试按照Yarn页的说明进行操作,并手动安装已安装在系统中的node.js.

I notice that node.js has system packages for Linux Mint up to version 17.2 , I tried to do all the instruction for the Yarn page and install manually node.js which was already installed in my system.

该消息并不能真正说明问题.如果我运行yarn --help,它可以工作,而我的yarn --version0.22

The message is not really explanatory of the problem. If I run yarn --help it works and my yarn --version is 0.22

这是我的Linux Mint系统

This is my Linux Mint system

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


更新


Update

这是终端/opt/yarn-0.22/bin中我的回声$PATH的输出,但是当我转到该路径时,没有文件夹/opt/yarn-0.22,因此我需要了解它的安装位置并正确配置

This is the output of my echo $PATH in the terminal /opt/yarn-0.22/bin, but when I go to that path, there is no folder /opt/yarn-0.22 so I need to understand where it was installed and configure correctly the 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.

非常感谢最好的祝福Fabrizio Bertoglio

Thanks a lot Best RegardsFabrizio Bertoglio

推荐答案

yarn是节点程序包管理器 yarn

yarn is node package manager yarn

您必须按照此处的说明进行安装安装指南 如果您有节点和npm,则可以安装它 通过

you have to install it as here instrauction installation guide If you have node and npm you can install it via



这篇关于Rails资产:未在系统中检测到预编译Yarn可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 11:36