Comments (8)
Rails 4 is supposed to support a DATABASE_URL environment variable out of the box, so writing a database.yml should no longer be required, however there has been some back and forth on the code in question.
from heroku-buildpack-ruby.
@schneems do you know if Rails 4 prefers that DATABASE_URL
? If not, then if you had a preexisting database.yml
with the default production.sqlite3
in the production:
setting that it would be bad... make sense? I don't currently have a Rails 4 app up on Heroku yet though to see.
from heroku-buildpack-ruby.
Can you provide specific issues you're seeing here? What isn't working? Stacktraces? Commands run?
Thanks.
from heroku-buildpack-ruby.
@hone Upon reading this thread, I realized that it was probably my fault. I double checked, and the problem was actually that the pg addon doesn't give db:reset privileges, which I interpreted to mean that my database connection from rails was failing. It appears to work fine now, so I'll close this out.
from heroku-buildpack-ruby.
This is quite annoying. I have a worker script in my rails 4 app that loads active record and connects to my heroku postgres without loading rails. I spent quite a few minutes banging my head against the wall before finding this issue and forking the buildpack for a quick fix. Perhaps this new behavior could be opt-in?
from heroku-buildpack-ruby.
Hey @gkop, you should be able to load your current database connection from the DATABASE_URL
environment variable with ActiveRecord::Base.establish_connection, were you trying that or trying to read from database.yml
?
from heroku-buildpack-ruby.
Hi @catsby.
This complained that I didn't specify an adapter:
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
And this didn't respect the url:
ActiveRecord::Base.establish_connection(adapter: "postgres", url: ENV['DATABASE_URL'])
Using Rails from git rails/rails@b5e4eb2.
My web dyno, where I load rails, is perfectly happy... it's the worker dyno, where I use active record on its own, that I miss database.yml.
from heroku-buildpack-ruby.
ah, my mistake, I recall that being in issue in at least rc1.
from heroku-buildpack-ruby.
Related Issues (20)
- Bug: Ruby EOL warning message is misleading HOT 1
- RuntimeError: failed to get urandom HOT 1
- Heroku doesn't support differentiated Gemfiles HOT 4
- Missing tag for v250 HOT 1
- ruby: integer overflow: 3689348814741910509 * 8 > 18446744073709551615 (RuntimeError) HOT 3
- Only add default web dyno if `config.ru` exists HOT 1
- Having `rack` gem is not a guarantee for having `rackup` executable (since Rack 3) HOT 2
- Heroku-22 fails installing gems HOT 3
- running ruby 3.2 with yjit HOT 1
- JRuby warns to use a more recent version, but it's blank
- Difficulties getting `rake assets:precompile` to work HOT 1
- JRuby 9.4.2.0 support? HOT 4
- Upgrade to Node 18 LTS HOT 1
- Using ruby 3.3.0 for preview release (as suggested in the notes) raises error with bundler HOT 2
- JRuby 9.4.4.0 support? HOT 1
- Support Bundler 2.4.20+ to enable `ruby file: '.ruby-version'` in Gemfile HOT 9
- Support Ruby 3.2.3 HOT 1
- Bundler 2.5.6 Causes Builds to Fail HOT 10
- Possible Bundler 2.5.6 Issues HOT 5
- ruby required for compiling webpack assets in rails build, missing from nodejs buildpack and stack 22 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-ruby.