Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/52.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 第一个RubyonRails应用程序的问题_Ruby On Rails_Command Line - Fatal编程技术网

Ruby on rails 第一个RubyonRails应用程序的问题

Ruby on rails 第一个RubyonRails应用程序的问题,ruby-on-rails,command-line,Ruby On Rails,Command Line,我正在尝试启动我的第一个rails应用程序,但它不起作用 我安装了纱线并检查它是否已安装 然后我键入了railswebacker:install。由于某种原因,节点没有安装,我为节点键入了post-install,但它仍然不起作用 作为一些背景资料,我有一台2012年年中的Mac,带有OS Mojave 10.14.6 ,Ruby版本2.6.3 ,RubyonRails版本6.0.0 和纱线版本1.19.1 我的代码: (base) Apples-MBP:~ apple$ cd desktop

我正在尝试启动我的第一个rails应用程序,但它不起作用

我安装了纱线并检查它是否已安装

然后我键入了
railswebacker:install
。由于某种原因,节点没有安装,我为节点键入了post-install,但它仍然不起作用

作为一些背景资料,我有一台2012年年中的Mac,带有OS Mojave 10.14.6 ,Ruby版本2.6.3 ,RubyonRails版本6.0.0 和纱线版本1.19.1

我的代码:

(base) Apples-MBP:~ apple$ cd desktop
(base) Apples-MBP:desktop apple$ cd portfolio
(base) Apples-MBP:portfolio apple$ rails s
=> Booting Puma
=> Rails 6.0.0 application starting in development 
=> Run `rails server --help` for more startup options
RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Exiting
Traceback (most recent call last):
在这之后,我得到了一个文件和宝石的清单,可能太长了,无法在这里发布

我希望Rails确认它正在运行,这样我就可以看到我在localhost:3000上的工作,但这是最终的结果

/Users/apple/.rvm/gems/ruby-2.6.3/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:91:in `rescue in load': Webpacker configuration file not found /Users/apple/Desktop/portfolio/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /Users/apple/Desktop/portfolio/config/webpacker.yml (RuntimeError)
(base) Apples-MBP:portfolio apple$

任何帮助都将不胜感激

首先在终端中安装brew并键入以下内容

/usr/bin/ruby-e“$(curl-fsSL)https://raw.githubusercontent.com/Homebrew/install/master/install)“

然后安装纱线:

brew install yarn
或手动执行此操作:

curl -o- -L https://yarnpkg.com/install.sh | bash
现在运行命令:

yarn install
rails webpacker:install

首先在终端中安装brew,并键入以下内容

/usr/bin/ruby-e“$(curl-fsSL)https://raw.githubusercontent.com/Homebrew/install/master/install)“

然后安装纱线:

brew install yarn
或手动执行此操作:

curl -o- -L https://yarnpkg.com/install.sh | bash
现在运行命令:

yarn install
rails webpacker:install

您应该在config/webpacker.yml中创建一个“development”部分
rails s
错误指示
请运行rails webpacker:install
-您需要在服务器启动之前成功运行该部分。您使用的是哪个版本的node,它是如何安装的?node没有成功安装,即使在我尝试使用post install命令之后。我将尝试单独安装节点,然后再次运行rails webpacker安装。您应该在配置/webpacker.ymlth中创建一个“开发”部分
rails s
错误指示
请运行rails webpacker:install
-您需要在服务器启动之前成功运行该部分。您使用的是哪个版本的node,它是如何安装的?node没有成功安装,即使在我尝试使用post install命令之后。我将尝试单独安装node,然后再次运行rails webpacker安装。我已经安装了Homebrew,rails现在可以工作了,我所需要做的就是重新安装它并单独安装Thread!谢谢所有的答案。我已经安装了自制软件,Rails现在可以工作了,我所需要做的就是重新安装它并单独安装!谢谢你的回答。