【发布时间】:2012-01-17 20:49:11
【问题描述】:
我的目标是在本地和暂存服务器上使用 Pry 作为我的 Rails 应用程序的控制台。但我无法让它在 Heroku 上运行。
我正在按照these 的说明让 Heroku 使用 Pry 作为我的 Rails 应用程序的控制台。当我运行heroku run console pry 时,我的控制台打印Running console pry attached to terminal... up, run.1 然后退出。当我运行heroku console pry 时,它只会显示main,然后退出。
关于我做错了什么有什么想法吗?
这是我到目前为止所做的:
在我的 Gemfile 中,我添加了以下几行:
gem 'pry'gem 'pry-rails'我创建了一个名为 pry 的文件,其中包含:
#!/usr/bin/env rubyrequire 'pry'pry我将以下内容添加到 config/environments 中的所有文件中:
silence_warnings dobeginrequire 'pry'IRB = Pryrescue LoadErrorendend运行
bundle install- 运行
git push staging master
【问题讨论】:
-
我认为把它放在项目根目录(与
Gemfile等相同的目录)是正确的。正如@JohnBachir 所提到的,确保您的 Gemfile 中也有gem 'pry',并且您已经运行了bundle install,然后将pry、Gemfile和Gemfile和Gemfile.lock添加到您的存储库,然后再将其推送到 Heroku。跨度> -
@Jordan,我已经这样做了;刚刚更新了问题以反映它。
标签: ruby-on-rails heroku pry