When I try to hit the rails command
$ rails ○○
Traceback (most recent call last):
4: from bin/rails:3:in `<main>`
3: from bin/rails:3:in `load`
2: from /Users/user/[Project name]/bin/spring:10:in `<top(required)>`
1: from /Users/user/[Project name]/bin/spring:10:in `read`
/Users/user/[Project name]/bin/spring:10:in `read`: No such file or directory @ rb_sysopen - /Users/user/[Project name]/Gemfile.lock(Errno::ENOENT)
I got an error like this and cried.
In the rails command, the contents of Gemfile.lock
are referenced because the gem version is also included in the confirmation process.
However, this time, there is no Gemfile.lock
to be referenced, so an error has occurred.
Gemfile.lock
keeps track of the version of gemfile
and is automatically generated by the bundle install
command, so you need to run bundle install
.
Immediately execute bundle install
on the application directory ↓
$ pwd
/Users/○○/app name
$ bundle install
Then try entering the rails command again. Then, the rails command should be working safely!
It may be pretty rudimentary, but I've taken a lot of time with this error in the past ... I hope fewer people suffer from the same error!
Recommended Posts