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
Related
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've been struggling getting around the well known bundler 2.0.x error when deploying to both Heroku and AWS Elastic Beanstalk. After trying many of the suggested remedies like updating gems and installing bundler 2.0.x or bundler update --system. None of this has worked so far. I found a solution to create a file in .ebextensions like so:
files:
# Runs before \./10_bundle_install.sh`:`
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_gem_install_bundler.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
# Source the application's ruby, i.e. 2.6. Otherwise it will be 2.3, which will give this error: \bundler requires Ruby version >= 2.3.0``
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_STAGING_DIR
echo "Installing compatible bundler"
gem install bundler -v 2.1.0.pre.2
This is the error I'm still getting on eb deploy staging-1:
Creating application version archive "app-7b50-191111_122622".
Uploading: [##################################################] 100% Done...
2019-11-11 17:28:21 INFO Environment update is starting.
2019-11-11 17:28:28 INFO Deploying new version to instance(s).
2019-11-11 17:31:36 ERROR [Instance: i-0ba40e32901557bee] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ystem, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.0.pre.2`
from /opt/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
from /opt/rubies/ruby-2.6.5/bin/bundle:23:in `<main>'.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-11-11 17:31:36 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-11-11 17:31:36 ERROR Unsuccessful command execution on instance id(s) 'i-0ba40e32901557bee'. Aborting the operation.
2019-11-11 17:31:37 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
[12:31:40] (master) tml_portal
// ♥ eb deploy staging-1
Creating application version archive "app-7b50-191111_123229".
Uploading: [##################################################] 100% Done...
2019-11-11 17:34:45 INFO Environment update is starting.
2019-11-11 17:34:53 INFO Deploying new version to instance(s).
2019-11-11 17:37:47 ERROR [Instance: i-0ba40e32901557bee] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ystem, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.0.pre.2`
from /opt/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:303:in `activate_bin_path'
from /opt/rubies/ruby-2.6.5/bin/bundle:23:in `<main>'.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2019-11-11 17:37:47 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2019-11-11 17:37:47 ERROR Unsuccessful command execution on instance id(s) 'i-0ba40e32901557bee'. Aborting the operation.
2019-11-11 17:37:48 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
Any ideas on how to get around this dreaded Bundler issue for deployment?
It still the missing bundle version error. Could you try following:
#.ebextensions/bundler_update.config
commands:
update_bundler:
command: /opt/rubies/ruby-2.6.5/bin/gem install bundler -v 2.1.0.pre.2
Ruby and Bundler version should match yours.
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.
I'm new to Rails so please bear with me.
Currently there is an existing project (Rails 4.1.6, Ruby 2.1.3) running on digital ocean VM (Ubuntu 14.04) and its connecting to Postgresdb 9.6 without any issues. I have to migrate this to new VM.
I have setup a new vm with Ubuntu 16.04, installed Rails and Ruby with exact same versions. I tried creating a test rails app and its working fine. However, when I tried to deployed the project from old server to this new one its giving me errors.
Details:
There was an error while trying to load the gem 'uglifier'.
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs /runtimes.rb:58:in `autodetect'
/usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/lib/ruby/gems/2.1.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib /active_support/dependencies.rb:247:in `require'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
After searching on internet, most of them suggested to uncomment this line in the Gemfile.
# gem 'therubyracer', platforms: :ruby
This was commented in the old server, however, I tried uncommenting it and it came back with different error.
Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development
Website was connecting to the same database and old webportal was running fine but it gave me this error. So I setup a new test db and ran the following commands -
RAILS_ENV=production bundle exec rake db:create
RAILS_ENV=production bundle exec rake db:setup
RAILS_ENV=production bundle exec rake db:migrate
All those commands were executed successfully but for some reason I'm still receiving "Migrations are pending....." error.
Please advise.
The migration-error seems to think you should be on the development environment... but the migrations you ran are for production... so either your environment-setting is not correct, or you need to run the migrations for development instead
After running
eb create projectname to deploy my rails project to amazon beanstack
I keep getting errors these errors. I have never used this service before and thought I would give it a try.. Here are the errors.
2015-10-02 17:23:50 UTC-0400 WARN Environment health has transitioned from Pending to Degraded. Command failed on all instances.
2015-10-02 17:23:38 UTC-0400 ERROR Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
2015-10-02 17:22:35 UTC-0400 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2015-10-02 17:22:35 UTC-0400 ERROR [Instance: i-c2e7f417] Command failed on instance. Return code: 1 Output: (TRUNCATED)...ndeck/config/environment.rb:5:in `<top (required)>' Gem::LoadError: sqlite3 is not part of the bundle. Add it to Gemfile. /var/app/ondeck/config/environment.rb:5:in `<top (required)>' Tasks: TOP => environment (See full trace by running task with --trace). Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
I am thinking it has something to do with the policys? there an easier way to set policy permissions?
It's not a policy error, it's an issue with your configuration. From the error you posted, this part
(TRUNCATED)...ndeck/config/environment.rb:5:in `' Gem::LoadError: sqlite3 is not part of the bundle. Add it to Gemfile.
indicates that your database.yml is misconfigured (since it defaults to SQLite) or you don't have the sqlite3 gem installed.