AWS Codebuild error while installing SASSC gem wrong ruby version - ruby-on-rails

I'm running a Codestar project. Sample app installs fine. When I add my application in with SASSC get failure, because of Ruby version. Is there away to notify CodeBuild to upgrade Ruby version? tried looking through buildspec.yml am I anywhere close? trying to google.
In middle of build logs
Installing sassc 2.0.0 with native extensions
Gem::InstallError: sassc requires Ruby version >= 2.3.3.
At end of build logs
An error occurred while installing sassc (2.0.0), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.0.0'` succeeds before bundling.
[Container] 2018/12/31 04:17:42 Command did not exit successfully bundle install exit status 5
[Container] 2018/12/31 04:17:42 Phase complete: INSTALL Success: false
[Container] 2018/12/31 04:17:42 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: bundle install. Reason: exit status 5
thanks.

I changed Codebuild environment from AWS Linux distro to Ubuntu with Ruby 2.5.3 which fixed my problem. Unless someone has a better answer.

Related

Rails Error Can't Find freedesktop.org.xml

I've had some issues starting a new RAILS project, where I'm getting an error that there is a missing file /usr/local/share/mime/packages/freedesktop.org.xml. There was a connection with the mimemagic dependencies, and I found this issue on GitHub about the mimemagic version and licensing - https://github.com/rails/rails/issues/41750
Wondering if anybody else ran into the issue, and could explain what is going on.
I'm using rbenv with ruby version: 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19], and rails 6.1.3
Here is the error message in the command line:
Installing railties 6.1.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mimemagic-0.3.7/ext/mimemagic
/Users/nico/.rbenv/versions/3.0.0/bin/ruby -I/Users/nico/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -rrubygems
/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/exe/rake
RUBYARCHDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
RUBYLIBDIR\=/Users/nico/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-19/3.0.0/mimemagic-0.3.7
rake aborted!
Could not find MIME type database in the following locations: ["/usr/local/share/mime/packages/freedesktop.org.xml",
"/opt/homebrew/share/mime/packages/freedesktop.org.xml", "/usr/share/mime/packages/freedesktop.org.xml"]
Ensure you have either installed the shared-mime-types package for your distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location of that file.
Tasks: TOP => default
(See full trace by running task with --trace)
rake failed, exit code 1
Thanks,
Nico
Found some links to shared-mime-info on the GitHub link I posted, and I solved the issue by running the command below and starting a new project:
brew install shared-mime-info
If you are on ubuntu OS you can run below command
sudo apt-get install shared-mime-info
If migrating data from an Intel Mac (or an M1 Mac running Rosetta 2) to an M1, note that mimemagic will cache the old directory, so in addition to brew install shared-mime-info, you'll want to run:
gem uninstall mimemagic
gem install mimemagic

Travis CI build errors Windows, Ruby on rails app

I have actually 3 errors in Travis CI:
Here are the logs:
1:
Gem::InstallError: rack requires Ruby version >= 2.2.2.
Installing erubis 2.7.0
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that `gem install rack -v '2.0.1'` succeeds before bundling.
The command "eval bundle install --jobs=3 --retry=3 --deployment" failed. Retrying, 2 of 3.
I installed `gem install rack -v '2.0.1' but I did not help.
Also I changed my travis.yml file so it is
rvm:
- 2.2.2
instead of:
rvm:
- 2.2
2:
Gem::InstallError: rack requires Ruby version >= 2.2.2.
Installing websocket-driver 0.6.4
An error occurred while installing mime-types-data (3.2016.0521), and Bundler
cannot continue.
Make sure that `gem install mime-types-data -v '3.2016.0521'` succeeds before
bundling.
I installed `mime-types-data -v '3.2016.0521' but I did not help.
3:
Searching for binary rubies, this might take some time.
Requested binary installation but no rubies are available to download, consider skipping --binary flag.
Gemset '' does not exist, 'rvm rbx-2 do rvm gemset create ' first, or append '--create'.
The command "rvm use rbx-2 --install --binary --fuzzy" failed and exited with 2 during .
My travis.yml:
language: ruby
rvm:
- 2.2.2
- jruby
- rbx-2
before_install:
- gem update
- gem --version
before_script:
- psql -c 'create database listapp_test;' -U postgres
addons:
postgresql: '9.3'
I tried to update racks but I didn't help.
Ruby ver: ruby 2.2.4.p230
Does anyone know how to fix it?
Sounds like you are installing gem in places that Bundler cannot find it. It is much easier if you post build log URL that shows the problems you are having.
Note that Travis CI cannot support Rubinius on Precise any longer (issue #3 above) due to https://github.com/rubinius/rubinius/issues/3717. Try using Trusty instead.

error deploying rails app aws elastic beanstalk

I'm using rails 5.00
i keep getting this error when trying to deploy to aws
[Instance: i-04fd37ed6913c4a8a] Command failed on instance. Return
code: 5 Output: (TRUNCATED)...ng uglifier 3.0.2 Installing unf 0.1.4
Installing turbolinks 5.0.1 Installing activesupport 5.0.0.1 An error
occurred while installing nokogiri (1.6.8), and Bundler cannot
continue. Make sure that gem install nokogiri -v '1.6.8' succeeds
before bundling. 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.
I ran into the same error "Make sure that gem install nokogiri -v '1.6.8' succeeds before bundling."
It was due to me not selecting the correct deployment version for ruby.
Initially when creating the environment I had left the ruby platform at default which happened to be version 2.3 (Passenger). Got the above error.
I terminated the environment and re-created it but chose ruby 2.2 (Puma) which is what I am using in my development environment.
The AWS environment was created without any errors.
Although the above corrective action fixed the problem, it does not explain why creating a ruby 2.3 (Passenger) environment failed especially since I did a sort of "canned" build - the environment creation was via AWS console using "sample application" in the config. I did not attempt to create it via eb command line or use any of my elasticbeanstalk scripts or deploy my own app.
You have two options to resolve your issue:
1) Add patch to .ebextensions/packages.config like this:
packages:
yum:
patch: []
This would make the yum package manager install it before attempting to bundle install.
2) Add a command config to .ebextensions/nokogiri_command.config like this:
commands:
test:
command: "bundle config build.nokogiri --use-system-libraries"
Either of these two options has worked for me. Don't forget to commit before pushing to AWS.

An error occurred while installing gcloud (0.8.1), and Bundler cannot continue - gcloud gem causes deploy to fail

When I run gcloud preview app deploy the deploy runs fine until it gets upto the point where its installing the gems. It errors out with:
Gem::RemoteFetcher::FetchError: bad response Not Found 404 (https://rubygems.global.ssl.fastly.net/gems/gcloud-0.8.1.gem)
Installing actionpack 4.2.0
Installing acts_as_commentable_with_threading 2.0.1
An error occurred while installing gcloud (0.8.1), and Bundler cannot continue.
Make sure that `gem install gcloud -v '0.8.1'` succeeds before bundling.
The command '/bin/sh -c bundle install --deployment && rbenv rehash' returned a non-zero code: 5
ERROR
ERROR: build step "gcr.io/cloud-builders/dockerizer" failed: exit status 1
ERROR: (gcloud.preview.app.deploy) Error Response: [2] Build failed; check build logs for details
Not sure if this is a known error or if there is a way around it?
Try to update your Google Cloud SDK and deploy your code again:
$ gcloud components update

RubyMine (7.0.4) is failing to install cmdparse because it requires Ruby 2.0.0

The project is using Ruby 1.9.3 and I can't change that. I'm using sauce and sauce-connect. I think they are bringing in cmdparse (3.0.1).
I only get an error when running bundle install from RubyMine. I can run this command from bash (Mac) with no problem. Now I can't run my tests from RubyMine. any advice?
The complete error...
Gem::InstallError: cmdparse requires Ruby version >= 2.0.0.
An error occurred while installing cmdparse (3.0.1), and Bundler cannot
continue.
Make sure that gem install cmdparse -v '3.0.1' succeeds before bundling.
Process finished with exit code 5

Resources