Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 纱线-v给出了我无法';我不明白_Ruby On Rails_Macos_Yarnpkg_Macos Mojave - Fatal编程技术网

Ruby on rails 纱线-v给出了我无法';我不明白

Ruby on rails 纱线-v给出了我无法';我不明白,ruby-on-rails,macos,yarnpkg,macos-mojave,Ruby On Rails,Macos,Yarnpkg,Macos Mojave,我在MacBookPro上设置rails开发环境时遇到问题。我以前开发过Rails(4.0-5.0),此后一直专注于另一个框架(MERN、Jekyll等)。我决定回到rails来创建一个小应用程序 因此,我将gem安装rails(使用rails6.0),它将显示成功,但会警告我一些错误 我会得到的错误与webpack.yml和纱线有关 我到处搜索,到处都是StackOverflow 在我的研究之后,有人建议我通过在config中创建webpack.yml来修复webpack.yml/(不知道为什

我在MacBookPro上设置rails开发环境时遇到问题。我以前开发过Rails(4.0-5.0),此后一直专注于另一个框架(MERN、Jekyll等)。我决定回到rails来创建一个小应用程序

因此,我将
gem安装rails
(使用rails6.0),它将显示成功,但会警告我一些错误

我会得到的错误与webpack.yml和纱线有关

我到处搜索,到处都是StackOverflow

在我的研究之后,有人建议我通过在config中创建webpack.yml来修复webpack.yml/(不知道为什么在使用
rails new myapp
时没有创建它)。问题解决了…现在转到纱线问题

所以我这样做了:

➜ myapp git:(master) ✗ yarn -v
Traceback (most recent call last):
    2: from /Users/johntowery/.rbenv/versions/2.6.4/bin/yarn:23:in `<main>'
    1: from /Users/johntowery/.rbenv/versions/2.6.4/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
/Users/johntowery/.rbenv/versions/2.6.4/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem yarn (>= 0.a) with executable yarn (Gem::GemNotFoundException)
附加信息
纱线已通过自制和其他方法安装。仍然没有帮助

如果您的ruby v2.6.0是默认的,那么您应该使用webpacker升级rails 6 及


希望对您有用

也许您还没有在Macbook中安装
纱线


尝试
brew安装Thread

是的,我确实使用了带有webpacker的Rails 6。(我不得不编辑我的问题,因为我似乎使用了初稿而不是最终稿)。纱线已安装。试过自制的、宝石等。似乎没有什么能帮上忙,也许这条路错了。使用
echo$PATH
查看路径配置,如果没有看到
/usr/local/bin
,请将
导出路径=“$PATH:/usr/local/bin”
添加到
.zshrc
并重新启动终端
Traceback (most recent call last):
    2: from /Users/johntowery/.rbenv/versions/2.6.4/bin/yarn:23:in `<main>'
    1: from /Users/johntowery/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path'
/Users/johntowery/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in `block in replace_bin_path': can't find executable yarn for gem yarn. yarn is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/