尝试执行任何以“rails”开头的命令会产生“找不到Gemfile”
我正在尝试安装新的rails应用程序。 我已经在我的机器上安装了几个rails应用程序,一切正常。
$ rails new app Could not locate Gemfile
然后我想我会运行一个跟踪来弄清楚发生了什么,因为你不希望此时有一个Gemfile
,因为通常上面的命令会在一个名为app
的目录中创建一个全新的rails应用app
。该Gemfile
包含的Gemfile
。
$ rails new app --trace Could not locate Gemfile
因此,我尝试通过此详细指南重新安装计算机上的所有内容:
http://railsapps.github.com/installing-rails.html#gems
在前20个步骤之后,我得到了这个命令:
$ rake -v Could not locate Gemfile
我假设某些地方的设置已关闭,但我看不到任何关闭。
这是我的rvm设置:
$ rvm version rvm 1.18.10 (latest) by Wayne E. Seguin , Michal Papis [https://rvm.io/] $ rvm list rvm rubies jruby-1.6.7 [ x86_64 ] ruby-1.9.1-p431 [ i386 ] ruby-1.9.3-p194 [ x86_64 ] ruby-1.9.3-p286 [ x86_64 ] ruby-1.9.3-p327 [ x86_64 ] =* ruby-1.9.3-p385 [ x86_64 ] # => - current # =* - current && default # * - default $ rvm gemset list gemsets for ruby-1.9.3-p385 (found in /Users/paul/.rvm/gems/ruby-1.9.3-p385) (default) global => rails32
以下是我的rails32 gemset上安装的gem
$ gem list *** LOCAL GEMS *** actionmailer (3.2.12, 3.2.11) actionpack (3.2.12, 3.2.11) activemodel (3.2.12, 3.2.11) activerecord (3.2.12, 3.2.11) activeresource (3.2.12, 3.2.11) activesupport (3.2.12, 3.2.11) arel (3.0.2) builder (3.0.4) bundler (1.2.4) erubis (2.7.0) hike (1.2.1) i18n (0.6.1) journey (1.0.4) json (1.7.7) mail (2.4.4) mime-types (1.21) multi_json (1.6.1) polyglot (0.3.3) rack (1.4.5) rack-cache (1.2) rack-ssl (1.3.3) rack-test (0.6.2) rails (3.2.12, 3.2.11) railties (3.2.12, 3.2.11) rake (10.0.3) rdoc (3.12.1) rubygems-bundler (1.1.0) rvm (1.11.3.6) sprockets (2.2.2) thor (0.17.0) tilt (1.3.3) treetop (1.4.12) tzinfo (0.3.35)
Bundler版本
$ bundle --version Bundler version 1.2.4
.gemrc文件
$ cat ~/.gemrc --- :backtrace: false :benchmark: false :bulk_threshold: 1000 :sources: - http://rubygems.org/ - https://rubygems.org :update_sources: true :verbose: true
一切看起来都很好,非常沮丧,请帮忙。
只有使用前缀为bundle exec
命令或当前目录中没有Gemfile
bundle install
时才会出现此错误。
我的假设是您可能正在运行启用bundler
命令,请检查:
which rake
找出运行的命令。
bundle install
在项目目录中为我修复了它。 之后,我遇到了这个错误:
Gemfile中出错,Bundler无法继续。
这是固定的:
gem update bundler
然后我重新安装Ruby和Rails终于工作了。 它只用了大约四个小时就可以了: – /
- 什么时候需要在rails Gemfile中使用require?
- 您的软件包已锁定到rake(12.0.0),但在Gemfile中列出的任何源中都找不到该版本。
- Rails gemfile编辑
- Bundler找不到某个版本的gem,但是同名的gem install有效
- Bundler / Gemfile如何配置为在开发期间使用不同的gem源?
- 将Ruby on Rails应用程序(OpenConferenceWare)部署到IBM Bluemix
- “您的Ruby版本是1.9.3,但您的Gemfile指定为1.9.3-p194”
- 安装debugger-linecache(1.1.1)时发生错误,Bundler无法继续
- Gemfile – 将生产gem与开发gem分开