Response_on_rails install: yarn error required

I am trying to configure response_on_rails for an existing rails 5.0 application according to the following instructions: https://github.com/shakacode/react_on_rails

  • gem "react_on_rails", "8.0.0"
  • rails create action_on_rails: install

I get the following error:

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

now this is my yarn, npm and node path:

 [ user@server ]$ which node /usr/bin/node [ user@server ]$ which npm /usr/bin/npm [ user@server ]$ which yarn ~/.yarn/bin/yarn 

How can I ensure its use of appropriate yarn and help set react_on_rails?

EDIT: This is my ~ / .bashrc file:

 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" 

This is the my / bin / yarn file in my 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 
+5
source share
2 answers

Can you use only yarn instead of yarnpkg ?

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

Not sure if one of them fixed this:

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

After that, the yarn worked.

0
source

Source: https://habr.com/ru/post/1270933/


All Articles