简体   繁体   中英

Can't create a new Ruby project

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:

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?

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

  • Uninstall all traces of Ruby and RailsInstaller on your system.
  • Ensure the RailsInstaller setup file says 3.3.0
  • Install RailsInstaller using the default options
  • 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.
  • Check installed Ruby version. (Should report v2.3.3 as per the website)
  • Then update all installed gems: (Important)
    1. gem update --system --no-ri --no-rdoc to update your Rubygems version
    2. gem update --no-document
  • Check Rails version. ( rails -v ) Should be 5.1.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM