[英]rails command does not work. getting error "Could not locate Gemfile or .bundle/ directory"
Whenever I try any rails command, even rails -v
, I keep getting the error - Could not locate Gemfile or .bundle/ directory
每当我尝试任何 rails 命令,甚至rails -v
,我都会收到错误 - Could not locate Gemfile or .bundle/ directory
Things I have already tried:我已经尝试过的事情:
gem install rails
(successfully installed) gem install rails
(安装成功)
gem update rails
gem update bundler
tried uninstalling bundler and reinstalling it.尝试卸载捆绑程序并重新安装它。
Current ruby -v is: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
当前的 ruby -v 是: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
None of the above worked.以上都没有奏效。 Any ideas?有任何想法吗?
If you have installed rails successfully rails -v
should work fine.如果您已成功安装 rails rails -v
应该可以正常工作。 For running bundle
you have to be in a Gemfile
directory.要运行bundle
您必须位于Gemfile
目录中。 Are you sure you are in the root directory of your app?您确定您在应用程序的根目录中吗? If not cd to your root directory and run the commands如果不是 cd 到您的根目录并运行命令
$ rails new my_app
$ cd my_app
$ bundle
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.