简体   繁体   English

在ruby教程中找不到gemfile

[英]could not locate gemfile in ruby tutorial

Im doing the railstutorial.org chap 2 toy app, everything from chapter 1 went fine, but when I tried to install bundle for the toy app, I got this 我正在做railstutorial.org第2章玩具应用程序,第1章中的所有内容都很好,但是当我尝试为玩具应用程序安装捆绑包时,我得到了

naylen@rails-tutorial:~/workspace/hello_app (master) $ cd ~/workspace naylen@rails-tutorial:~/workspace $ rails 4.2.0.rc3 new toy_app (it installed all the files) naylen @ rails-tutorial:〜/ workspace / hello_app(master)$ cd〜/ workspace naylen @ rails-tutorial:〜/ workspace $ rails 4.2.0.rc3新的toy_app(安装了所有文件)

than I put: naylen@rails-tutorial:~/workspace $ toy_app/ naylen@rails-tutorial:~/workspace $ bundle install --without production Could not locate Gemfile 比我说的要多:naylen @ rails-tutorial:〜/ workspace $ toy_app / naylen @ rails-tutorial:〜/ workspace $ bundle install --without production无法找到Gemfile

I copied the same instructions I got for the gemfile from the book, which is this: source 我复制了本书中关于gemfile的相同指令,即:source

' https://rubygems.org ' ' https://rubygems.org '

gem 'rails', '4.2.0.rc3' gem'rails','4.2.0.rc3'

gem 'sass-rails', '5.0.0.beta1' gem'sass-rails','5.0.0.beta1'

gem 'uglifier', '2.5.3' 宝石'uglifier','2.5.3'

gem 'coffee-rails', '4.1.0' 宝石'咖啡轨','4.1.0'

gem 'jquery-rails', '4.0.0.beta2' gem'jquery-rails','4.0.0.beta2'

gem 'turbolinks', '2.3.0' gem'turbolinks','2.3.0'

gem 'jbuilder', '2.2.3' 宝石'jbuilder','2.2.3'

gem 'sdoc', '0.4.0', group: :doc gem'sdoc','0.4.0',组::doc

group :development, :test do gem 'sqlite3', '1.3.9' gem 'byebug', '3.4.0' gem 'web-console', '2.0.0.beta3' gem 'spring', '1.1.3' end 组:development,:test do gem'sqlite3','1.3.9'gem'byebug','3.4.0'gem'web-console','2.0.0.beta3'gem'spring','1.1.3 ' 结束

group :production do gem 'pg', '0.17.1' gem 'rails_12factor', '0.0.2' end group:production do gem'pg','0.17.1'gem'rails_12factor','0.0.2'结尾

and still it said that it could not locate the file. 仍然说找不到文件。 I refreshed and tried again, and I got this: 我刷新并再次尝试,我得到了:

naylen@rails-tutorial:~/workspace $ cd ~/workspace naylen@rails-tutorial:~/workspace $ rails 4.2.0.rc3 new toy_app exist naylen @ rails-tutorial:〜/ workspace $ cd〜/ workspace naylen @ rails-tutorial:〜/ workspace $ rails 4.2.0.rc3新的toy_app存在

identical README.rdoc 相同的README.rdoc

identical Rakefile 相同的Rakefile

identical config.ru 相同的config.ru

identical .gitignore 相同的.gitignore

conflict  Gemfile

Any idea what I'm doing wrong???? 知道我在做什么错吗????

Once you create the app, you need to change into its directory to execute Bundler commands. 创建应用程序后,需要切换到其目录以执行Bundler命令。

(Based on the excerpts in your question, it appears that you're still in workspace , while the Gemfile is located in toy_app .) (根据问题摘录,您似乎仍在workspace ,而Gemfile位于toy_app 。)

For example: 例如:

$ rails new blah_app
$ cd blah_app
$ bundle (whatever)

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

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