简体   繁体   中英

“could not locate gemfile” when doing bundle install on existing rails project

I've been given an existing rails project that I am trying to play around with. however, when I try to run bundle install or rake db:migrate, I run into problems so essentially, i can't really do anything with the code I've been given.

The biggest problem as I see it right now is the fact that it can't locate my gemfile when I bundle install?

How can I find my gemfile.. is there supposed to be one in the root folder of the application?

Is there another step I need to take to initialize an existing project that someone has just copied and pasted to me? Thanks!

Yes, you should have a Gemfile in the root directory of your app.

If you are developing in a Rails 2 app, you might want to check out the Bundler.io page about Rails 2.3:

http://bundler.io/v1.7/rails23.html

If you are using Rails 3+ you can take a learn from Bundler's page on Rails 3 use:

http://bundler.io/v1.7/rails3.html

If you just need to get started with a Gemfile , go to a different directory and generate a dummy app:

$ rails new temporary-app

Copy over the Gemfile to your directory. It will only have the default gems listed, but you may be able to "discover" your needed gems as you go. If you happen to have a Gemfile.lock file then you can see the gems that you need at the top of the dependency tree.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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