Posts

Showing posts with the label Heroku

Can't Connect To Heroku Postgresql Database From Local Node App With Sequelize

Answer : OK, found the answer by browsing sequelize source code : https://github.com/sequelize/sequelize/blob/master/lib/dialects/postgres/connection-manager.js#L39 To activate SSL for PG connections you don't need native: true or ssl: true but dialectOptions.ssl: true so the following did finally work: sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', protocol: 'postgres', dialectOptions: { ssl: true } }); You no longer need to parse the DATABASE_URL env variable, there is a Sequelize constructor which accepts the connection URL: sequelize = new Sequelize(process.env.DATABASE_URL, { dialect: 'postgres', protocol: 'postgres', dialectOptions: { ssl: true } }); One needs to add dialectOptions under ssl "development": { "username": process.env.DB_USERNAME, "password": process.env.DB_PASSWORD, "database": proce...

Bundler: You Must Use Bundler 2 Or Greater With This Lockfile

Answer : I had a similar experience. Here's how I solved it Display a list of all your local gems for the bundler gem gem list bundler N/B : The command above is for rbenv version manager, the one for rvm might be different This will display the versions of the bundler gem installed locally bundler (2.1.4, default: 1.17.2) if you don't have bundler version 2 installed locally, then run gem install bundler OR gem install bundler -v 2.1.4 if you have bundler version 2 already installed locally or just installed it, then you need to simply install an update for RubyGems Package Manager locally. To do this, run gem update --system And then finally run bundle update --bundler For Docker projects in Ruby on Rails If you're experiencing this issue when trying to build your application using Docker, simply do this: Delete the Gemfile.lock file Please don't create it again by running bundle install . Run your docker build or docker-compose build comm...

Automate Heroku CLI Login

Answer : The Heroku CLI only uses your username and password to retrieve your API key, which it stores in your ~/.netrc file ( $HOME\_netrc on Windows). You can manually retrieve your API key and add it to your ~/.netrc file: Log into the Heroku web interface Navigate to your Account settings page Scroll down to the API Key section and click the Reveal button Copy your API key Open your ~/.netrc file, or create it, with your favourite text editor Add the following content: machine api.heroku.com login <your-email@address> password <your-api-key> machine git.heroku.com login <your-email@address> password <your-api-key> Replace <your-email@address> with the email address registered with Heroku, and <your-api-key> with the API key you copied from Heroku. This should manually accomplish what heroku login does automatically. However, I don't recommend this. Running heroku login does the same thing more easily an...