How to fix “bundler: command not found: rails” whe

2019-08-17 02:30发布

I am trying to deploy my Rails app to Google Cloud using App Engine Flexible Environment. Everything works fine when I run gcloud app deploy, but at the very end, when App Engine tries to run my application using bundle exec rails server -p $PORT, as specified in my app.yaml file, it crashes and gives the following error message:

Error Response: [9] Application startup error: 'bundler: command not found: rails Install missing gem executables with bundle install

I tried changing the entrypoint value, running bundle install again and again, and installing all my gem files locally, but none of that worked. I also tried installing rack and changing the endpoint to run the app using rackup command, but that didn't work either. I am also skipping my gemfile.lock in my app.yaml file due to a previous error that was solved on SO.

2条回答
放我归山
2楼-- · 2019-08-17 02:45

I think you'd also want to install bundler in your container instance.

gem install bundler
查看更多
放荡不羁爱自由
3楼-- · 2019-08-17 02:45

The reason I was getting this error is because I was skipping the Gemfile.lock due to a previous error that I thought was solved here. The aforementioned 'solution' led to this error. The solution that I found is to make some edits to Gemfile.lock that solved the issue instead of avoiding it. The edits can be seen here.

查看更多
登录 后发表回答