繁体   English   中英

我刚刚在 rails 上安装了 ruby 并且我创建了一个文件夹但是当我运行 rails s 时它会这样说。 我试过捆绑安装并从论坛搜索

[英]I just installed ruby on rails and i have created a folder but when i run rails s its says this. i have tried bundle install and searched from forums

C:/Ruby31-x64/lib/ruby/3.1.0/bundler/resolver.rb:268:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'rails (~> 7.0.1)' in locally installed gems. (Bundler::GemNotFound)
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/resolver.rb:252:in `each'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/resolver.rb:252:in `verify_gemfile_dependencies_are_found!'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/resolver.rb:48:in `start'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/resolver.rb:23:in `resolve'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/definition.rb:269:in `resolve'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/definition.rb:476:in `materialize'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/definition.rb:190:in `specs'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/definition.rb:238:in `specs_for'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/runtime.rb:18:in `setup'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler.rb:151:in `setup'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/setup.rb:20:in `block in <top (required)>'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/ui/shell.rb:136:in `with_level'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/ui/shell.rb:88:in `silence'
        from C:/Ruby31-x64/lib/ruby/3.1.0/bundler/setup.rb:20:in `<top (required)>'
        from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/railsprojects/project1/config/boot.rb:3:in `<top (required)>'
        from bin/rails:3:in `require_relative'
        from bin/rails:3:in `<main>'

确保 Gemfile 中的语法正确。 例如:

gem 'some-gem ', '0.0.1' #空格

gem 'some-gem' '0.0.1' #缺少逗号

正确的是: gem 'some-gem', '0.0.1'

您还可以检查此资源以确认您没有错过任何内容。 https://gorails.com/setup/windows/10

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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