2017-08-16 1 views
5

Je suis en train de react_on_rails de configuration pour un rails existants 5.0 application selon les instructions suivantes: https://github.com/shakacode/react_on_railsreact_on_rails installation: fil est nécessaire erreur

  1. gem "react_on_rails", "8.0.0"
  2. rails générer react_on_rails: installer

Je reçois l'erreur suivante:

ERROR: yarn is required. Please install it before continuing. https://yarnpkg.com/en/docs/install 

maintenant ceci est mon fils, NPM et chemin noeud:

[[email protected]]$ which node 
/usr/bin/node 
[[email protected]]$ which npm 
/usr/bin/npm 
[[email protected]]$ which yarn 
~/.yarn/bin/yarn 

Comment puis-je assurer qu'il utilise le fil approprié et aider à installer react_on_rails?

EDIT: Ceci est mon fichier ~/.bashrc:

export PATH="$HOME/.rbenv/bin:$PATH" 
eval "$(rbenv init -)" 


export NVM_DIR="$HOME/.nvm" 
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 

export PATH="$PATH:$HOME/.yarn/bin" 

Ceci est mon/bin/fil sous mon application:

#!/usr/bin/env ruby 
VENDOR_PATH = File.expand_path('..', __dir__) 
Dir.chdir(VENDOR_PATH) do 
    begin 
    exec "yarnpkg #{ARGV.join(" ")}" 
    rescue Errno::ENOENT 
    $stderr.puts "Yarn executable was not detected in the system." 
    $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install" 
    exit 1 
    end 
end 
+0

Quel système d'exploitation utilisez-vous et comment avez-vous installé le fil? –

+0

pouvez-vous lancer 'yarn install'? Quelle est la sortie? – Anthony

+0

Serait mieux si vous installez le fil avec infusion. Mais de toute façon, ajoutez à votre fichier '.bashrc':' export PATH = "$ PATH: 'yarn global bin'" 'comme décrit dans [docs] (https://yarnpkg.com/fr/docs/install) avoir accès aux exécutables de Yarn globalement et assurez-vous que vous avez rechargé votre fichier '~/.bashrc' avec' source ~/.bash_profile'. – iskvmk

Répondre

0

Peut-on utiliser simplement yarn au lieu de yarnpkg?

exec "yarn #{ARGV.join(" ")}" 
0

Je ne sais pas si l'on suit le fixe:

unset https_proxy 
unset http_proxy 

npm config set proxy http://user:****@ip 
npm config set https-proxy http://user:***@ip 

Après que le fil a travaillé.