Travis build fails in Yeoman Angular generated app - travis-ci

I'm not being able to build an angular application generated with Yeoman using angular-generator. It fails when uses compass gem. I've already added the compass gem installation to the build descriptor.
This is my .travis.yml file:
language: node_js
node_js:
- '0.8'
- '0.10'
before_script:
- 'gem update --system'
- 'gem install compass'
- 'npm install -g bower grunt-cli'
- 'bower install'
The error I'm getting is the following:
Warning: /home/travis/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sass/script/node (LoadError)

I solved similar problem following this link.
In short, I put the following versions in the .travis.yml file:
'gem install sass --version "=3.2.12"'
'gem install compass --version "=0.12.2"'

Related

Can't use Nokogiri gem on M1 processor

I have a problem with using the M1 processor and Nokogiri gem.
Gemfile
...
gem 'nokogiri', '>= 1.13.5'
...
When I run bundle install, all seems good, but when I try to run specs, for example, I see the error:
LoadError:
dlopen(/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle, 0x0009): tried: '/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle
I've tried to install Nokogiri with gem install nokogiri -v 1.13.6 --platform arm64-darwin, and now it looks like that:
nokogiri -versions:
# Nokogiri (1.13.6)
---
warnings: []
nokogiri:
version: 1.13.6
cppflags:
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri"
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri/include"
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri/include/libxml2"
ldflags: []
ruby:
version: 2.7.2
platform: arm64-darwin21
gem_platform: arm64-darwin-21
description: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin21]
engine: ruby
libxml:
source: packaged
precompiled: true
patches:
- 0001-Remove-script-macro-support.patch
- 0002-Update-entities-to-remove-handling-of-ssi.patch
- 0003-libxml2.la-is-in-top_builddir.patch
- 0004-use-glibc-strlen.patch
- 0005-avoid-isnan-isinf.patch
- 0006-update-automake-files-for-arm64.patch
- '0008-htmlParseComment-handle-abruptly-closed-comments.patch'
- '0009-allow-wildcard-namespaces.patch'
libxml2_path: "/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri"
memory_management: ruby
iconv_enabled: true
compiled: 2.9.14
loaded: 2.9.14
libxslt:
source: packaged
precompiled: true
patches:
- 0001-update-automake-files-for-arm64.patch
datetime_enabled: true
compiled: 1.1.35
loaded: 1.1.35
other_libraries:
zlib: 1.2.12
libiconv: '1.16'
libgumbo: 1.0.0-nokogiri
But when I try to run specs with this version only, I have an error:
Could not find nokogiri-1.13.6 in any of the sources
Run `bundle install` to install missing gems.
So to avoid this error, I have to install Nokogiri through bundle install, but it installs the wrong version, not for the arm platform, and then I have a problem with the platform. If I install Nokogiri through the gem install command, the bundler doesn't see it.
My bundle config:
Settings are listed in order of priority. The top value will be used.
build.libv8
Set for the current user (/Users/ruslan/.bundle/config): "--with-system-v8"
build.libxml-ruby
Set for the current user (/Users/ruslan/.bundle/config): "--with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config"
build.nokogiri
Set for your local app (/Users/ruslan/3commas/3commas/.bundle/config): "--use-system-libraries"
default
Set for the current user (/Users/ruslan/.bundle/config): "2.2.21"
force_ruby_platform
Set for your local app (/Users/ruslan/3commas/3commas/.bundle/config): true
Set for the current user (/Users/ruslan/.bundle/config): true
github.https
Set for the current user (/Users/ruslan/.bundle/config): "true"
Maybe somebody knows how to figure out this problem? Many thanks in advance! 🙏
I wonder if this is an issue related to the Gemfile.lock file, which can have explicit platforms to bundle for. You can check by looking for PLATFORMS within that file.
If you add Apple's ARM platform to your setup via bundler, that may help the correct version of nokogiri to be bundled? Try running the following on the command line:
bundle lock --add-platform arm64-darwin-21

bundler: Using a custom path while using system gems is unsupported

I am using GitLab-CI/CD to build my Rails application. I have noticed my builds are failing due to Using a custom path while using system gems is unsupported error, which were working perfectly fine before.
Tried to check newer update releases but didn't find any issues. Does any one have any idea on recent updates or somthing on mentioned issue?
Bellow is my gitlab-ci.yml
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: ${CI_JOB_NAME}
paths:
- vendor/ruby
before_script:
- apt-get update -qq
- ruby -v
- which ruby
- gem --version
- git --version
- gem update --system 2.7.6
- gem install bundler -v 2.0.1
- bundle -v
- bundle config ${REPO_URL} ${BUNDLE_GITLAB__TOKEN}
- bundle config --global disable_shared_gems true
- bundle install --jobs $(nproc) "${FLAGS[#]}" --path vendor
rubocop:
tags:
- rubocop
script:
- bundle exec rubocop
# rspec:
# stage: test
# script:
# - bundle exec rspec
And bellow is the brief error I'm getting
$ apt-get update -qq
$ ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
$ which ruby
/usr/local/bin/ruby
$ gem --version
3.0.3
$ git --version
git version 2.20.1
$ gem update --system 2.7.6
Updating rubygems-update
Successfully installed rubygems-update-2.7.6
Installing RubyGems 2.7.6
Bundler 1.16.1 installed
RubyGems 2.7.6 installed
Regenerating binstubs
------------------------------------------------------------------------------
RubyGems installed the following executables:
/usr/local/bin/gem
/usr/local/bin/bundle
RubyGems system software updated
$ gem install bundler -v 2.0.1
Successfully installed bundler-2.0.1
1 gem installed
$ bundle -v
Bundler version 2.0.1
$ bundle config https://gitlab.com/dharshannn/test-star.git ${BUNDLE_GITLAB__TOKEN}
$ bundle config --global disable_shared_gems true
$ bundle install --jobs $(nproc) "${FLAGS[#]}" --path vendor
Using a custom path while using system gems is unsupported.
path:
Set for your local app (/usr/local/bundle/config): "vendor"
path.system:
Set via BUNDLE_PATH__SYSTEM: true
disable_shared_gems:
Set for the current user (/root/.bundle/config): true
ERROR: Job failed: exit code 1
The same happened to me today. I am pretty sure that there was no update to bundler or gem. The Docker image however has been updated (I was using ruby:2.6.3). I also added a new dependency when this started happening, so I suspect it was dependent on a gem which was already installed in the system path thus the error message.
You can get around it by specifying the following configuration variables in your .gitlab-ci.yml:
variables:
BUNDLE_DISABLE_SHARED_GEMS: "true"
BUNDLE_PATH__SYSTEM: "false"
This will configure Bundler to not use shared gems and disable system gems fully.
See https://bundler.io/v2.0/bundle_config.html
disable_shared_gems (BUNDLE_DISABLE_SHARED_GEMS): Stop Bundler from accessing gems installed to RubyGems' normal location.
and
path.system (BUNDLE_PATH__SYSTEM): Whether Bundler will install gems into the default system path (Gem.dir).

not available Gem::SafeYAML when to run 'bundle install'

When I try to run bundle install from the project, I get the following error:
unavalible Gem :: SafeYAML when to run 'bundle install'
my version of rubygem is:
2.0.14
After investigating what I could solve with the following steps:
1.-Download the zip file from the following download and add it to the root of the project
2.- If you don't have any RubyGems installed, there is still the pre-gem approach to getting software, doing it manually:
2.1-Download from above
2.2-Unpack into a directory and cd there
2.3-Install with: ruby setup.rb (you may need admin/root privilege)
2.4- like sudo:
gem update --system
3. run:
bundle install

Bitbucket Pipelines - Failed to build gem native extension

Am I missing build tools in my configuration file?
I'm trying to integrate Bitbucket Pipelines with a Ruby project.
I am unable to build native gem extensions. My C knowledge is limited. If anyone has experience with this input is appreciated. The build fails where trying to install faraday
Installing faraday 0.9.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...
Makefile:241: recipe for target 'fast.o' failed
make: *** [fast.o] Error 1
make failed, exit code 2
My bitbucket-piplines.yml looks like
image: ruby:2.4.0
pipelines:
default:
- step:
caches:
- bundler
script:
- echo $PRIVATE_KEY > ~/.ssh/id_rsa.tmp
- base64 -d ~/.ssh/id_rsa.tmp > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- base64 ~/.ssh/id_rsa
- gem install oj -v '2.9.9'
- gem install faraday -v '0.9.2'
- bundle config git.allow_insecure true
- bundle install
- bundle exec rspec
definitions:
caches:
bundler: ./vendor
So it was an issue with my Ruby version. Fixnum is no longer a function in Ruby 2.4. It was a matter of downgrading the Ruby Docker image, or updating the failing gems. I downgraded while I'm getting my tests set up to image: ruby:2.3.4

GitLab Hosted Ruby Version Issue

I'm testing out a simple Rails project with hosted GitLab. My repository has Ruby version 2.3.0 and Rails version 5.0.1. I created the basic gitlab-ci.yml file with the below code for CI. When GitLab goes to run this file through the pipeline to add it I get the error:
activesupport-5.0.1 requires ruby version >= 2.2.2, which is incompatible with
the current version, ruby 2.1.10p492
I'm not sure how to change the version of Ruby that GitLab is using. Any suggestions on how to resolve this issue?
gitlab-ci.yml
before_script:
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
- ruby -v
- which ruby
- gem install bundler --no-ri --no-rdoc
- bundle install --jobs $(nproc) "${FLAGS[#]}"
rspec:
script:
- bundle exec rspec
rubocop:
script:
- bundle exec rubocop
You define the environment in which the code is run by using a Docker image.
Try adding
image: ruby:2.3.0
to the top of your .gitlab-ci.yml file

Resources