简体   繁体   English

为什么我的导轨不运行?

[英]Why does my rails not run?

When I run $ rails -server to start a server, there comes an error:当我运行$ rails -server启动服务器时,出现错误:

Could not find gem 'sqlite3' in any of the gem sources listed in your Gemfile or available on this machine.在您的 Gemfile 中列出的任何 gem 源中找不到 gem 'sqlite3' 或在这台机器上可用。

Does that mean I did not install sqlite3 ?这是否意味着我没有安装sqlite3 How can I resolve the issue?我该如何解决这个问题?

First, you have to install all Gems from your Gemfile .首先,您必须从Gemfile安装所有 Gems。

This can be done with bundle install or in short bundle .这可以通过bundle install或简称bundle来完成。

If this command executed successfully, you can run your server with rails s .如果此命令成功执行,您可以使用rails s运行您的服务器。

But I think it's better for you, to start with a tutorial .但我认为最好从教程开始。

server and s are not a switch, but a sub-command. servers不是开关,而是子命令。

Run

$ rails server

or或者

$ rails s

I run into this issue previously, that is because you run bundle install, miss some gems, so you can $ bundle install again,我之前遇到过这个问题,那是因为你运行bundle install,错过了一些gems,所以你可以再次$ bundle install

and you can test the sqlite if is installed:如果已安装,您可以测试 sqlite:

$ sqlite3 --version

If successed, you can test the rails server .如果成功,您可以测试rails server

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

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