Ruby on Rails - 制作新应用程序时出错(rb:55:'require') [英] Ruby on Rails - Error making new app (rb:55:in 'require')

查看:155
本文介绍了Ruby on Rails - 制作新应用程序时出错(rb:55:'require')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直关注Mike Hartl出色的 Ruby on Rails教程`。



我不得不早些做出关于gem文件和ruby版本的决定。我决定(在一些问题得到Heroku的工作后,我会直接模仿所描述的ruby的教程和版本 - 导致我用 rvm use 2.0.0 来设置我的版本的红宝石。



在第一章中,所有内容都很棒,但是现在当我尝试创建一个新的rails项目时,出现错误消息:

  $ rails new demo_app 




/home/huw/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require':无法加载这样的文件 - rails / cli(LoadError)
from /home/huw/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0 /rubygems/core_ext/kernel_require.rb:55:in
要求'
from / usr / bin / rails:9:in''


我不知道这意味着什么...但是,当它引用我的ruby版本时,我猜测我的rails和ruby版本不同步...



有人可能会建议p可能的选择是:


  1. 重置我的ruby版本更新到最新版本(但我不知道用$ geb创建的
    会发生什么冲突!)
  2. 从rails 4.1降级到rails 4(我相信这是Mike Hardl的版本)

  3. 以某种方式强制事物

我是一个完整的rails Noob,不知道该从哪里开始 - 或者如果那个错误代码甚至支持我的假设!

解决方案

按照 zwippie's 在评论部分的回答,解决方案如下完成。





gem install rails 成功挂上第二个安装的导轨后。我现在可以添加一个新项目。



我不确定为什么会发生这种情况,因为我已经在这台笔记本电脑上成功制作了新的rails项目,过去两周的目录,甚至直到今天早上。但是,zwippie指出,这可能是一个RVM设置问题。我会离开,并阅读,但如果任何人有任何额外的文件指针可能揭示这个问题,我很感激评论中的任何链接。



许多感谢所有。


I've been following Mike Hartl's excellent Ruby on Rails Tutorial`.

I had to make some decisions earlier about versions for gem files and ruby. I decided (after some problems getting Heroku to work that I'd directly mimic the tutorial and versions of ruby described - leading me to go with rvm use 2.0.0 to set my version of ruby.

All was great on chapter one but now I'm getting an error message when i try to create a new rails project:

$ rails new demo_app

/home/huw/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- rails/cli (LoadError) from /home/huw/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:inrequire' from /usr/bin/rails:9:in `'

I have no idea what that means... but as its referencing my ruby version I'm guessing that my rails and ruby versions are out of sync...

Could someone advise on possible courses of action?

I imagine possible options would be:

  1. Reset my ruby version to the latest (but I don't know what clashes that would create with gems!)
  2. Downgrade from rails 4.1 to rails 4 (I believe that's Mike Hardl's version)
  3. Force things through somehow

I'm a complete rails Noob however, and have no idea where to begin on any of those options - or if that error code even backs up my assumptions!

解决方案

As per zwippie's answer in the comment section, the solution was achieved as follows.

rails -v produced a very similar looking output to the error message above.

gem install rails after hanging for a second installed rails successfully. I am now able to add a new project.

I'm unsure why this has happened as I've been successfully making new rails projects both on this laptop and in this directory for the last two weeks, even up until this morning. However as zwippie notes perhaps this is an RVM setup issue. I'll go away and read up but if anyone had any additional pointers from documentation that might shed light on the issue I'm appreciate any links in the comment.

Many thanks all.

这篇关于Ruby on Rails - 制作新应用程序时出错(rb:55:'require')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆