rake db:migrate:在任何源代码中都找不到nio4r-2.1.0运行`bundle install`来安装缺少的gem

时间:2017-10-10 12:31:02

标签: ruby-on-rails ruby rubygems bundle

我在Windows 10上设置了一个rails应用程序并且要迁移数据库但是我遇到了问题

rake db:migrate
Could not find nio4r-2.1.0 in any of the sources
Run `bundle install` to install missing gems.

我有更新并安装blundler

任何人都知道为什么这很开心

gem_make.out告诉我:

You have to install development tools first.
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:588:in `try_cpp'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1095:in `block in have_header'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:945:in `block in checking_for'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:351:in `block in postpone'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:321:in `open'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:347:in `postpone'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:944:in `checking_for'
    from D:/Ruby24-x64/lib/ruby/2.4.0/mkmf.rb:1094:in `have_header'
    from extconf.rb:5:in `<main>' 

我错过了什么。

3 个答案:

答案 0 :(得分:0)

我认为你缺少Ruby for windows的开发工具包。转到以下链接https://rubyinstaller.org/downloads/并下载提到的/最新版本的Ruby。

如果问题仍然存在,请随时评论此答案。

答案 1 :(得分:0)

最后我已经解决了这个问题,我正在使用电源外壳..而且它无法运行..现在使用cmd并且它可以工作:)

答案 2 :(得分:0)

您正在使用系统的rails。您必须先运行gem install rake,然后再运行rake db:migrate

相关问题