无法创建新的Ruby项目

时间:2022-06-01 18:58:29

I have just started learning Ruby on Rails and I'm stuck in the beginning! I have installed the package from http://www.railsinstaller.org/ and followed the installation steps. Yet when I type: rails new rubyProject I get the following:

我刚开始学习Ruby on Rails而且我一开始就陷入困境!我已经从http://www.railsinstaller.org/安装了软件包,并按照安装步骤进行操作。然而当我输入:rails new ruby​​Project我得到以下内容:

Gem::InstallError: ffi requires Ruby version <2.5, >= 2.0.
An error occurred while installing ffi <1.9.18>, and bundler cannot continue.
Make sure that 'gem install ffi -v '1.9.18''succeeded before bundling.

I've read a number of articles but non of them worked for me. Can you help me?

我读了很多文章,但没有一篇文章适合我。你能帮助我吗?

1 个解决方案

#1


0  

RailsInstaller does contain a few known bugs. Lets take a step back and start from scratch.

RailsInstaller确实包含一些已知的错误。让我们退后一步,从头开始。

  • Uninstall all traces of Ruby and RailsInstaller on your system.
  • 卸载系统上所有Ruby和RailsInstaller的痕迹。

  • Ensure the RailsInstaller setup file says 3.3.0
  • 确保RailsInstaller安装文件说3.3.0

  • Install RailsInstaller using the default options
  • 使用默认选项安装RailsInstaller

  • Open the patched version of your cmd.exe (you'll find a new shortcut in your Start Menu) and configure Git and DevKit tools for your system. Here on always work using this cmd.exe. It will start in C:/Sites and will automatically show you your Git n Ruby versions.
  • 打开cmd.exe的修补版本(您将在“开始”菜单中找到新的快捷方式)并为您的系统配置Git和DevKit工具。这里总是使用这个cmd.exe工作。它将从C:/ Sites开始,并将自动显示您的Git n Ruby版本。

  • Check installed Ruby version. (Should report v2.3.3 as per the website)
  • 检查已安装的Ruby版本。 (应根据网站报告v2.3.3)

  • Then update all installed gems: (Important)
    1. gem update --system --no-ri --no-rdoc to update your Rubygems version
    2. gem update --system --no-ri --no-rdoc更新您的Rubygems版本

    3. gem update --no-document
    4. gem update --no-document

  • 然后更新所有已安装的gem :(重要)gem update --system --no-ri --no-rdoc更新你的Rubygems版本gem更新--no-document

  • Check Rails version. (rails -v) Should be 5.1.2
  • 检查Rails版本。 (rails -v)应为5.1.2

#1


0  

RailsInstaller does contain a few known bugs. Lets take a step back and start from scratch.

RailsInstaller确实包含一些已知的错误。让我们退后一步,从头开始。

  • Uninstall all traces of Ruby and RailsInstaller on your system.
  • 卸载系统上所有Ruby和RailsInstaller的痕迹。

  • Ensure the RailsInstaller setup file says 3.3.0
  • 确保RailsInstaller安装文件说3.3.0

  • Install RailsInstaller using the default options
  • 使用默认选项安装RailsInstaller

  • Open the patched version of your cmd.exe (you'll find a new shortcut in your Start Menu) and configure Git and DevKit tools for your system. Here on always work using this cmd.exe. It will start in C:/Sites and will automatically show you your Git n Ruby versions.
  • 打开cmd.exe的修补版本(您将在“开始”菜单中找到新的快捷方式)并为您的系统配置Git和DevKit工具。这里总是使用这个cmd.exe工作。它将从C:/ Sites开始,并将自动显示您的Git n Ruby版本。

  • Check installed Ruby version. (Should report v2.3.3 as per the website)
  • 检查已安装的Ruby版本。 (应根据网站报告v2.3.3)

  • Then update all installed gems: (Important)
    1. gem update --system --no-ri --no-rdoc to update your Rubygems version
    2. gem update --system --no-ri --no-rdoc更新您的Rubygems版本

    3. gem update --no-document
    4. gem update --no-document

  • 然后更新所有已安装的gem :(重要)gem update --system --no-ri --no-rdoc更新你的Rubygems版本gem更新--no-document

  • Check Rails version. (rails -v) Should be 5.1.2
  • 检查Rails版本。 (rails -v)应为5.1.2