Closed kmiyashiro closed 8 years ago
I've got a similar issue, when running docker-compose build
:
Airbrake::Error: both :project_id and :project_key are required /app/heroku/ruby/bundle/ruby/2.2.0/gems/airbrake-ruby-1.4.3/lib/airbrake-ruby/notifier.rb:34:in `initialize'
It seems that is always running the build step with RAILS_ENV=production
, even when explicitly exporting or setting RAILS_ENV=development
.
Hardcoding the values as strings in the initializer got me past the build step, but after bringing up the container with docker-compose up web
it still does not serve anything on localhost:8080
. Trying to attach to the container with docker attach
just hangs.
Made a fix to avoid having to hard-code Airbrake values in order to get the build to work, and the clarified development environment setup instructions accordingly: https://github.com/DevProgress/HillaryBNB/commit/7c239b30cb7213615416cf7e85864d14b53b1ad2
Following those instructions I am able to get the site up and running and serving traffic on localhost:8080. (I sometimes have had to run docker-compose up -d web
multiple times before the server will start; not sure why.)
FWIW these are the docker versions I'm using:
% docker -v Docker version 1.11.2, build b9f10c9 % docker-compose -v docker-compose version 1.7.1, build 0a9ab35
Leaving this issue open, pending verification of fix.
Confirmed this is the fix. However, it doesn't work by going to localhost:8080 since I have to point it to the docker machine IP. This raises another issue with the docs since Google OAuth doesn't requires a hostname and disallows IPs, I'll open another issue.
Not mentioned in the README what to do for these variables in development mode: https://github.com/DevProgress/HillaryBNB/commit/78a92a2c042d54e33538560a95cf95bf7aeacc7b#diff-33e8e74514712ce4597178028340798dR16
I've tried setting in my env vars and even hardcoding it into the airbrake initializer, I always get this error when trying to run
export RAILS_ENV=development; docker-compose up -d web
.Stack
``` Building web Step 1 : FROM heroku/ruby # Executing 7 build triggers... Step 1 : COPY Gemfile Gemfile.lock /app/user/ ---> Using cache Step 1 : RUN bundle install --path /app/heroku/ruby/bundle --jobs 4 ---> Using cache Step 1 : ADD . /app/user Step 1 : ENV RAILS_ENV production ---> Running in 324658287fa8 Step 1 : ENV SECRET_KEY_BASE $(openssl rand -base64 32) ---> Running in 66f38f6ae100 Step 1 : RUN bundle exec rake assets:precompile ---> Running in 85e9fdda2aa3 warning: parser/current is loading parser/ruby22, which recognizes warning: 2.2.5-compliant syntax, but you are running 2.2.3. warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri. rake aborted! Airbrake::Error: both :project_id and :project_key are required /app/heroku/ruby/bundle/ruby/2.2.0/gems/airbrake-ruby-1.4.3/lib/airbrake-ruby/notifier.rb:34:in `initialize' /app/heroku/ruby/bundle/ruby/2.2.0/gems/airbrake-ruby-1.4.3/lib/airbrake-ruby.rb:105:in `new' /app/heroku/ruby/bundle/ruby/2.2.0/gems/airbrake-ruby-1.4.3/lib/airbrake-ruby.rb:105:in `configure' /app/user/config/initializers/airbrake.rb:11:in `