简体   繁体   English

创建新的Rails项目并运行rails -v时出错

[英]Error when creating new rails project and running rails -v

I'm new to rails and I seem to get this error whenever I try to create a new project. 我是Rails的新手,每次尝试创建新项目时,似乎都会收到此错误。 Does anybody have any insight into what I need to do with this error message? 是否有人对我需要如何处理此错误消息有任何见解? I get the same error when running 'rails -v' 运行“ rails -v”时出现相同的错误

/Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'json' (~> 1.4) among 137 total gem(s) (Gem::LoadError)
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1271:in `block in activate_dependencies'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1260:in `each'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1260:in `activate_dependencies'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1242:in `activate'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1274:in `block in activate_dependencies'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1260:in `each'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1260:in `activate_dependencies'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1242:in `activate'
from /Users/buckleyjosh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:48:in `gem'
from /Users/buckleyjosh/.rvm/gems/ruby-1.9.3-p194/bin/rails:18:in `<main>'
from /Users/buckleyjosh/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/buckleyjosh/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

The error is exactly what it's complaining about: 该错误正是它所抱怨的:

Could not find 'json' (~> 1.4) among 137 total gem(s)

Install that gem before you fire any rails commands : gem install json 在触发任何rails命令之前安装该gem:gem install json

If you're using rvm, make sure you've the right version of ruby loaded before installing the gem. 如果您使用的是rvm,请在安装gem之前确保已加载正确版本的ruby。
Read this more information on what this gem does. 阅读宝石的更多信息。

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

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