longkat
longkat

Reputation: 33

Rails : Could not locate Gemfile

/Users/mac/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.4/lib/bundler/shared_helpers.rb:24:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
    from /Users/mac/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.4/lib/bundler/shared_helpers.rb:29:in `default_lockfile'
    from /Users/mac/.rvm/gems/ruby-2.1.3@global/gems/bundler-1.7.4/lib/bundler.rb:253:in `default_lockfile'
    from /Users/mac/bin/spring:10:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'

hi,

when i try to run 'rails new myproject' or 'rails -v' i have this message but rails is installed. i don't understand. Someone can help me.

Thanks for your help.

Upvotes: 2

Views: 9483

Answers (2)

Akilas
Akilas

Reputation: 51

I had the exact problem.

As it turned out, the problem was I had a hidden ./bin directory. When I run rails new myapp, it's using binaries in the bin folder. In my case it was ./bin/spring specifically.

I removed this ./bin directory and all is well now.

Upvotes: 4

MrPizzaFace
MrPizzaFace

Reputation: 8086

It's either not in the proper path or it isn't installed. Do this gem install bundler also if you are running rails -v you should get a version like this:

rails -v
Rails 4.2.0.beta2

If you don't, then that means rails is not installed either. Run gem install rails

Here is information of setting up rails: http://guides.rubyonrails.org/getting_started.html

Upvotes: 1

Related Questions