Tôi cố gắng để react_on_rails thiết lập cho một đường ray hiện có 5,0 ứng dụng theo hướng dẫn sau đây: https://github.com/shakacode/react_on_railsreact_on_rails cài đặt: sợi được yêu cầu báo lỗi
- gem "react_on_rails", "8.0.0"
- ray tạo react_on_rails: cài đặt
tôi nhận được lỗi sau:
ERROR: yarn is required. Please install it before continuing. https://yarnpkg.com/en/docs/install
bây giờ điều này là sợi, NPM và nút của tôi đường dẫn:
[[email protected]]$ which node
/usr/bin/node
[[email protected]]$ which npm
/usr/bin/npm
[[email protected]]$ which yarn
~/.yarn/bin/yarn
Làm thế nào để tôi đảm bảo nó bằng cách sử dụng sợi thích hợp và giúp đỡ cài đặt react_on_rails?
EDIT: Đây là của tôi tập tin ~/.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"
Đây là/bin/file sợi của tôi dưới ứng dụng của tôi:
#!/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
Bạn đang sử dụng hệ điều hành nào và cách bạn lắp đặt sợi? –
bạn có thể chạy 'cài đặt sợi' không? Đầu ra là gì? – Anthony
Sẽ tốt hơn nếu bạn lắp đặt sợi với bia. Nhưng dù sao, hãy thêm sau vào '.bashrc':' export PATH = "$ PATH: 'sợi toàn cầu của sợi'" như được mô tả trong [docs] (https://yarnpkg.com/en/docs/install) để có quyền truy cập vào tệp thi hành của Yarn trên toàn cầu và đảm bảo bạn đã tải lại tệp '~/.bashrc' của mình bằng' source ~/.bash_profile'. – iskvmk