Disabling Irb Autocomplete on Heroku

Disabling irb autocomplete on Heroku

Your application's root directory ends up being the application's user's home directory at Heroku so you could put a .irbrc in your application's root directory. So add your .irbrc with IRB.conf[:USE_AUTOCOMPLETE] = false to your app's root directory so that it looks like this:

$ cd your_app_root_directory
$ ls -1A
.git/
...
.irbrc # <-----------------
...
Gemfile
Gemfile.lock
Procfile
README.md
Rakefile
app/
bin/
config/
config.ru
db/
...

Then, once you push everything up to Heroku, heroku run console will use that .irbrc.

Disable irb autocomplete

Try putting this in your ~/.irbrc

IRB.conf[:USE_AUTOCOMPLETE] = false

Heroku destroys pg gem during deployment

Set your pg gem to require version 0.2x in your Gemfile:

gem 'pg', '~> 0.20'

What's happening is you're system is incorrectly attempting to use a newer, incompatible version of pg. pg 1.0.0 was released January 10, 2018, but it's not currently supported by rails. Since you aren't specifying which version of pg to use, you're system is trying to use the new version of pg, removing the old version, then failing.

See this rails issue, and this rails issue and this fix (Revert to pg 0.21.0 as Rails does not support pg 1.0.0 yet) for more discussion.

rake assets:precompile failed when push rails5 app to heroku

Finnaly I solve this problem with remove heroku_rails_deflate gem from my Gemfile and delete Gemfile.lock and rerun bundle install then push to heroku.

You can see the app from: http://cdcnv.herokuapp.com

heroku push error: Could not detect rake tasks

Sometimes Heroku throws an issue on deployment about assets. You can precompile assets and push it to Heroku.

RAILS_ENV=production bundle exec rake assets:precompile

Update:

In case of it doesn't work, make sure to add
RAILS_SERVE_STATIC_FILES env. to yr server.

Make it enabled or true nor anything :)

Because in Rails <5.1 production.rb has

config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?

Heroku: App -> Settings -> "Reveal Config Vars"

Sample:
Sample Image



Related Topics



Leave a reply



Submit