修复Rails和服务器以及在Nitrous.io上

编程入门 行业动态 更新时间:2024-10-25 20:20:36
本文介绍了修复Rails和服务器以及在Nitrous.io上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在Nitrous.io上做一个月Rails的教程.有一次,我的树上出现了一些奇怪的文件,我删除了它们.一切都停止了工作.

I was doing One Month Rails's tutorial on Nitrous.io. At one point, some weird files appeared on my tree, and I deleted them. Everything stopped working.

我跑了

$ git add . $ git checkout -f

并恢复了树.

但是,当我跑步时:

$ rails server

我得到:

action@first-project-48185:~/pinteresting$ rails server -bash: rails: command not found

我也尝试过:

$ ruby -v #and got an older version, so I reinstalled it $ rails -v action@first-project-48185:~/pinteresting$ rails -v -bash: rails: command not found

我跑步时:

$ ruby -v #on MAC terminal, I get the correct version $ rails -v #on MAC terminal, I get the correct version

有趣的是,当我跑步时:

Interestingly, when I run:

$ rails server or $ rails server -p 4000

我得到:

Franciscos-MacBook-Pro:pinteresting franciscomello$ rails server /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)

以及下面的其他文字:

from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `rescue in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:2:in `<top (required)>' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' from /Users/franciscomello/Desktop/pinteresting/config/application.rb:7:in `<top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>' Franciscos-MacBook-Pro:pinteresting franciscomello$ rails server -p 4000 /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError) from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:6:in `rescue in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.8/lib/sqlite3.rb:2:in `<top (required)>' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require' from /Library/Ruby/Gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require' from /Users/franciscomello/Desktop/pinteresting/config/application.rb:7:in `<top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' from /Library/Ruby/Gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>' from bin/rails:4:in `require' from bin/rails:4:in `<main>'

令人沮丧的是我正处于最大状态,没有任何错误或错误:(

What's frustrating is I was on my largest streak without any errors or bugs :(

有什么想法吗?

推荐答案

我不能说出Rails为什么不再因这些错误而工作,但我建议您重新安装Rails.运行以下命令以重新安装Rails:

I can't tell why Rails is no longer working from those errors, but I would recommend reinstalling rails. Run the following command to reinstall Rails:

gem install rails

从这里您应该可以运行rails server.

From here you should be able to run rails server.

如果Gemfile包含需要安装的其他gem,也可以在项目目录中运行bundle install.

You could also run bundle install within the project directory if your Gemfile includes other gems which need to be installed.

更多推荐

修复Rails和服务器以及在Nitrous.io上

本文发布于:2023-11-25 22:30:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器   Rails   io   Nitrous

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!