Why won't Pry run in Heroku's console?

蓝咒 提交于 2019-12-05 05:10:00

I am the one who developed the method for Heroku and Pry but you brought up an interesting case that I didn't think about since I mostly deploy with Sinatra and EM and build my own helpers and such. Either way:

To use Pry with Heroku while having a Rails app you just need to add pry-rails and pry to your gemfile (as a normal Gem) and then bundle install and then git [commit|push] and run heroku run console on Cedar stack. Step 3 of what you did where you adjusted config/environments does not and should not be done so please revert that change if you can. After you do that and remove the pry script from the root of your app (well you don't necessarily need to do the latter) Pry will load with your Rails properly.

I've just used the instructions at https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry to set it up, pry file goes in the root of your project. Commit and push to Heroku - I'm using the Cedar stack.

Effect a console session to heroku run console pry - I did find that I did then need to execute pry to be dropped into a pry prompt but it then worked as I'd expect.

UPDATE: Just to be clear, I added pry to Gemfile and created the pry file as instructed. Is your problem that you are locking pry in your gemfile to dev/test - are you running your apps on Heroku in those environments? Hence why you're getting undefined methods?

You probably have to list it in your bundler Gemfile.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!