简体   繁体   中英

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.

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.

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

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