繁体   English   中英

创建新的Rails项目时出错

[英]Getting error when creating new rails project

当我尝试创建一个新的Rails项目时,出现此错误。我从未遇到此错误。

/usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'activesupport' (= 4.2.5) - did find: [activesupport-4.2.4,activesupport-4.2.3,activesupport-4.2.1,activesupport-4.2.0,activesupport-4.1.5,activesupport-4.1.4,activesupport-4.1.1,activesupport-4.0.13,activesupport-4.0.4,activesupport-4.0.0,activesupport-3.2.16,activesupport-3.2.13,activesupport-3.2.11,activesupport-3.2.9,activesupport-3.2.2,activesupport-3.1.3,activesupport-3.0.3] (Gem::LoadError)
Checked in 'GEM_PATH=/home/techbirds/.rvm/gems/ruby-2.2.1:/home/techbirds/.rvm/gems/ruby-2.2.1@global', execute `gem env` for more information
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1311:in `block in activate_dependencies'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `each'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1300:in `activate_dependencies'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1282:in `activate'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:67:in `block in gem'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `synchronize'
    from /usr/share/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:66:in `gem'
    from /home/techbirds/.rvm/gems/ruby-2.2.1/bin/rails:22:in `<main>'
    from /home/techbirds/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/techbirds/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

好像您没有安装gem依赖项

Could not find 'activesupport' (= 4.2.5) - did find: [activesupport-4.2.4,activesupport-4.2.3 ..... activesupport-3.0.3] (Gem::LoadError)

在创建新的Rails应用程序时指定rails版本

rails _4.2.16_ new my_app # change the version accordingly
# You must have rails 4.2.16 installed 

似乎您收到此错误,因为rvm没有使用更新的版本的ruby。
运行此命令

rvm list
这将为您提供系统上安装的所有ruby版本,以及您的计算机正在使用哪个ruby版本。然后通过此命令选择最新的ruby版本

rvm use ruby version

暂无
暂无

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

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