简体   繁体   English

bundle exec rails总是返回rails文档

[英]bundle exec rails always returns rails documentation

When running 跑步时

bundle exec rails c

or any other rails command like server or runner rails always returns the output of "rails help" 或任何其他Rails命令(例如服务器或流道rails)始终返回“ rails help”的输出

The same installation runs successfully on an other server. 同一安装在另一台服务器上成功运行。

This is assuming you use rvm . 这是假设您使用rvm

The fact that you copied it from another server probably means you are using the ruby gemset that came with that installation. 您从另一台服务器复制它的事实可能意味着您正在使用该安装随附的ruby gemset。 This might be missing on your new system. 您的新系统上可能缺少此功能。

In your appfolder, run: rvm gemset list to see which gemset you are using. 在您的appfolder中,运行: rvm gemset list以查看您使用的是哪个gemset。 Equally you could look for .rvmrc or .ruby-gemset and .ruby-version in the root folder of your app. 同样,您可以在应用程序的根文件夹中查找.rvmrc.ruby-gemset.ruby-version

rvmrc is outdated but these files should contain ruby version and gemset name that is being used by the app. rvmrc已过时,但这些文件应包含应用程序正在使用的ruby版本和gemset名称。

Switch to that gemset with: 使用以下命令切换到该gemset:

rvm gemset use <gemset name>

or if it doesn't exist use: 或者,如果不存在,请使用:

rvm use --create <ruby version>@<gemset name>

Then to install all gems run: 然后安装所有gem运行:

bundle install

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

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