I am trying to push a Ruby on Rails projekt to my Flynn remote. I am getting this error:
-----> Discovering process types
remote: -e:1:in `<main>': undefined method `keys' for false:FalseClass (NoMethodError)
remote: ERROR: Build failed: exec: job exited with status 1
I have no 'keys' in any ruby file, and I am not even sure if that is what is meant with this error. Is there any logs with further information about the error? The project is working fine locally using Foreman, and an older version is also working fine at Flynn.
This is likely a configuration error and you will need to make sure your environment variables that you've set locally are available in your Flynn environment,
You can set your environment variables on Flynn with the CLI.
Related
I'm trying to upgrade an app from Rails 6 to Rails 6.1.6.1 and I'm running into the following error using credentials. My production credentials file contains the following:
aws:
bucket_prefix: "some-prefix"
But when I try to deploy to Heroku, I'm getting the following:
-----> Detecting rake tasks
!
! Could not detect rake tasks
! ensure you can run `$ bundle exec rake -P` against your app
! and using the production group of your Gemfile.
! rake aborted!
! NoMethodError: undefined method `[]' for nil:NilClass
!
! config.dynamic_assets.bucket_prefix = Rails.application.credentials.aws[:bucket_prefix]
! ^^^^^^^^^^^^^^^^
The app starts up just fine with RAILS_ENV=production rails s locally.
Would someone please point me as to what I might be doing wrong?
This error is telling you that Rails.application.credentials.aws is returning nil.
What this usually means is that Heroku doesn't have your RAILS_MASTER_KEY, so it can't access your credentials.yml.enc file.
Using the Heroku dashboard or the CLI, you need to set an environment variable called RAILS_MASTER_KEY to match the key in your master.key file.
For a great walkthrough, check out this SO answer.
If you have set this environment variable, check to make sure you haven't added credentials.yml.enc to your .gitignore list.
If Heroku doesn't have your credentials.yml.enc file, then it can't access the credentials inside it, even with the master key.
I enabled enhanced language metrics for the ruby language metrics in Heroku for a Ruby on Rails application, following the documentation (barnes gem etc.). This worked successfully.
Later on I saw errors when inspecting something in the system through the rails console heroku console --app my-rails-app-name. Any call of a model constant example lead to the following output:
Running console on ⬢ my-rails-app-name... up, run.8724 (Standard-1X)
irb(main):001:0> MyModel.all.count
Traceback (most recent call last):
4: from /app/vendor/bundle/bin/console:29:in `<main>'
3: from /app/vendor/bundle/bin/console:29:in `load'
2: from /app/vendor/bundle/ruby/2.6.0/gems/countries-3.0.0/bin/console:14:in `<top (required)>'
1: from (irb):1
NameError (uninitialized constant MyModel)
The work around is to run the rails console explicitly
heroku run rails console --app my-rails-app-name
Because the enhanced language metrics needs loading another build pack we can suspect that this is the reason for this. But don't give up! The order in which the build packs are executed can be configured. So drag the heroku/metrics buildpack above the heroku/ruby build pack, deploy one more time and afterwards you should be able to stick to your workflow :)
I have similar error like here
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
My question is not why it fails, but rather how could I get more verbose information from heroku?
heroku logs -t doesn't work because it's a fresh app.
In heroku logs command -t means tail and will show only new logs since you start this command. You can look at previous logs by using heroku logs without passing extra options.
Also it may be helpful to install add-on for log management like Papertrail or Logentries
My application is running fine over Elasticbeanstalk. as i have connected my repo with gemnasium, so it said about outdated gems and i updated them.
1: First i just ran the bundle update command then deployed i got error
Creating application version archive "app-51c4-160115_105334".
Uploading evercam-admin-live/app-51c4-160115_105334.zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: [Instance: i-40adb5c9] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ror: cannot load such file -- bundler/setup
/var/app/ondeck/config/boot.rb:3:in `<top (required)>'
/var/app/ondeck/config/application.rb:1:in `<top (required)>'
/var/app/ondeck/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace).
container_command 01seed in .ebextensions/seed.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-40adb5c9'. Aborting the operation.
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
After searching around over stackoverflow i found out that updating each gem separately will be better and did the same.
Gems with no version number. i did bundle update gemname and for those who are with version number i updated version number in gemfile and again did the the same bundle update gemname
2: it updated the gem as well. and then i deployed that branch again.
and got the EXACT same error again.
anyhelp will be appreciated thanks
I've a rails project which I want to deploy on Heroku. I am using the link https://github.com/ddollar/heroku-accounts for managing multiple accounts on heroku. But whenever i am running the command heroku accounts:set personal It is showing an error like that
warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
! Heroku client internal error.
! Search for help at: https://help.heroku.com
! Or report a bug at: https://github.com/heroku/heroku/issues/new
Error: undefined method `each' for nil:NilClass (NoMethodError)
Backtrace: /Users/sumitkalra1984/.heroku/plugins/heroku- accounts/lib/accounts/heroku/command/accounts.rb:111:in `set'
/Users/sumitkalra1984/.heroku/client/lib/heroku/command.rb:213:in `run'
/Users/sumitkalra1984/.heroku/client/lib/heroku/cli.rb:28:in `start'
/usr/bin/heroku:24:in `<main>'
Command: heroku accounts:set personal
Plugins: heroku-accounts
Version: heroku-toolbelt/3.0.0 (x86_64-darwin10.8.0) ruby/1.9.3
I bet the you found a solution to your problem, but just in case (and for other like me) you just have to init a git repo. If you try this command in a directory without git repo you will get this error.
Cheers !