I have a node app that I am deploying through Gitlab. I am using docker image node:12.8.0.
Recently it has been failing deployment with the following error
$ dpl --provider=heroku --app=$HEROKU_DEVELOPMENT_APP --api-key=$HEROKU_API_KEY --skip-cleanup
Installing deploy dependencies
ERROR: Error installing dpl-heroku:
faraday requires Ruby version >= 2.4.
Successfully installed multipart-post-2.1.1
Successfully installed ruby2_keywords-0.0.2
/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- dpl/provider/heroku (LoadError)
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:93:in `rescue in block in new'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:68:in `block in new'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:41:in `fold'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/provider.rb:67:in `new'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:31:in `run'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/lib/dpl/cli.rb:7:in `run'
from /var/lib/gems/2.3.0/gems/dpl-1.10.15/bin/dpl:5:in `'
from /usr/local/bin/dpl:22:in `load'
from /usr/local/bin/dpl:22:in `'
Running after_script
00:01
Running after script...
$ echo "Job - $CI_JOB_NAME ended."
Job - deploy_development ended.
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
I am unable to install Ruby2.4 through apt-get install ruby2.4.
Any advice would be appreciated.
Thanks
I had the same problem today in Gitlab CI.
The problem is that Node uses debian stretch (version 9) by default as the base for docker images, at least in the 12.x LTS versions. This version of debian has Ruby 2.3.3 by default in the repositories, which is not supported by Faraday, which requires a version equal to or greater than 2.4.
What I did was use the 12.x-buster tag (notice the -buster at the end of the version tag) and in these images of docker Node uses debian buster (version 10) as a base. This version of debian has Ruby 2.5.5 repositories by default, which allows Faraday to be installed and therefore dpl for heroku works normally.
Those running into this issue on travis-ci, I was able to do it by adding a before_deploy command to specify the version of faraday to use.
...
before_deploy:
- rvm $(travis_internal_ruby) --fuzzy do ruby -S gem install faraday -v 1.8.0
deploy:
provider: heroku
api_key: $HEROKU_API_KEY
...
More details: https://travis-ci.community/t/heroku-deploy-fails-installing-dpl-heroku-encounters-faraday-error/12563/6?u=hallmanitor
Related
I'm trying to use fastlane on Windows, which is installed from Bundler -- which is installed by Ruby Gem. But while running, some internal error of Ruby seems blocked the execution.
First, I went to Ruby Installer and installed Ruby+Devkit 3.0.2-1 (x64); then, I installed the Bundler and Fastlane using gem command. Error below happened when I was trying to execute them -- which I believed was not related to Bundler nor Fastlane:
C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `winsize': Bad file descriptor - <STDIN> (Errno::EBADF)
from C:/Ruby30-x64/lib/ruby/3.0.0/reline/ansi.rb:157:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/reline.rb:168:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/3.0.0/forwardable.rb:238:in `get_screen_size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:236:in `size_from_readline'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:66:in `size'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/tty-screen-0.8.1/lib/tty/screen.rb:76:in `width'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane_core/lib/fastlane_core/print_table.rb:95:in `transform_output'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:335:in `print_plugin_information'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/plugins/plugin_manager.rb:316:in `load_plugins'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/commands_generator.rb:39:in `start'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/fastlane/lib/fastlane/cli_tools_distributor.rb:122:in `take_off'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fastlane-2.197.0/bin/fastlane:23:in `<top (required)>'
from C:/Ruby30-x64/bin/fastlane:23:in `load'
from C:/Ruby30-x64/bin/fastlane:23:in `<main>'
I'm using Windows 10 home version 20H2.
Rebooting the computer doesn't solve the problem.
I tried googling the question, but it seems that problem hasn't be reported (or be answered). I don't know where I can report the bug either.
What can I do? Any help would be appreciated!
I had this same error when I tried running bundle exec fastlane in git bash.
I got it working by running it in powershell instead.
I'm using my work laptop to contribute to a non-work open-source project. At work we use rbenv to manage Ruby versions, but the open-source project appears to expect gem dependencies to be located in the system Ruby install folder. So when I try to run certain of the project's commands, I'm running into missing gem errors.
The project is Homebrew, and the command I'm running is brew style. When I run the command in my local, I get the following:
Ignoring rainbow-2.2.2 because its extensions are not built. Try: gem pristine rainbow --version 2.2.2
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rainbow (LoadError)
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/richie.thomas/.gem/ruby/2.3.0/gems/rubocop-0.50.0/lib/rubocop.rb:4:in `<top (required)>'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/richie.thomas/.gem/ruby/2.3.0/gems/rubocop-0.50.0/bin/rubocop:6:in `<top (required)>'
from /Users/richie.thomas/.gem/ruby/2.3.0/bin/rubocop:22:in `load'
from /Users/richie.thomas/.gem/ruby/2.3.0/bin/rubocop:22:in `<main>'
Running gem environment returns the following:
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.10
- RUBY VERSION: 2.3.3 (2016-11-21 patchlevel 222) [x86_64-darwin15]
- INSTALLATION DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: /Users/richie.thomas/.gem/ruby/2.3.0
- RUBY EXECUTABLE: /Users/richie.thomas/.rbenv/versions/2.3.3/bin/ruby
- EXECUTABLE DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/bin
- SPEC CACHE DIRECTORY: /Users/richie.thomas/.gem/specs
....
I've been advised by other contributors that the easiest path forward would be to disable or uninstall rbenv in order to run the command. I'd really like to avoid uninstalling and reinstalling rbenv every time I want to run this command, but there is nothing in the rbenv documentation that mentions this.
Is there any one-time command I can run, or any configuration setting I can change, so that I can do what I need to do?
I re-ran gem environment and noticed that the following environment variables were defined:
INSTALLATION DIRECTORY: /Users/richie.thomas/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0
USER INSTALLATION DIRECTORY: /Users/richie.thomas/.gem/ruby/2.3.0
The value of INSTALLATION DIRECTORY is what I expected to be used to run the command, and I noticed the value of USER INSTALLATION DIRECTORY is what showed up in the error stacktrace.
Since I was unable to figure out how my machine was determining which variable to use, I simply renamed ~/.gem/ to ~/.gem2/ and re-ran the brew style command I originally wanted. This was successful!
I'm trying to use yarn here and got into a problem that might be related to ruby.
On executing any yarn command, I get the error .../.rvm/gems/ruby-2.3.0/gems/yarn-0.1.1/lib/yarn/server.rb:14:in <class:Server>': uninitialized constant Socket::SOL_TCP (NameError)
Error Stack:
$ yarn
.../.rvm/gems/ruby-2.3.0/gems/yarn-0.1.1/lib/yarn/server.rb:14:in <class:Server>': uninitialized constant Socket::SOL_TCP (NameError)
Did you mean? Socket::SO_TYPE
from .../.rvm/gems/ruby-2.3.0/gems/yarn-0.1.1/lib/yarn/server.rb:6:in <module:Yarn>'
from .../.rvm/gems/ruby-2.3.0/gems/yarn-0.1.1/lib/yarn/server.rb:4:in <top (required)>'
from .../.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from .../.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require'
from .../.rvm/gems/ruby-2.3.0/gems/yarn-0.1.1/bin/yarn:26:in <top (required)>'
from .../.rvm/gems/ruby-2.3.0/bin/yarn:23:in load'
from .../.rvm/gems/ruby-2.3.0/bin/yarn:23:in <main>'
from .../.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval'
from .../.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
Any ideas on the cause of this?
You may have the yarn gem installed (a web-server) and its associated executable at the same time that you are running the yarn command for the package manager. If so, and you intend to use the package manager, then simply gem uninstall yarn and y to remove the executable when prompted. All that you should need to run the package manager is to brew install yarn.
You should delete yarn gem:
gem uninstall yarn
and install yarn again:
yarn
yarn install v1.9.2.
success Already up-to-date.
✨ Done in 0.77s.
And after that, last step
yarn build
248 hidden modules ✨ Done in 4.95s.
I was getting the same error in ruby-2.2.4. I was able to overcome the problem by updating ruby to the latest version.
It looks like the Socket Server is crashing, so older ruby version may have an updated socket class?
I have ruby 2.0.0p247 [x64-mingw32] with Gem 2.2.2 installed on Windows 8. I have a persistent problem gem that is making it virtually unusable. Whenever I try to install a new gem, I invariably get:
ERROR: While executing gem ... Invalid spec cache file in C:/Users/...
In the past, I've been able to run gem update or gem update --system and that would clear up the problem for one, single gem install. Subsequent install would fail with the same error. Now even gem update fails with that error message.
I've tried deleting the users/.../.gem directory. When I do that, gem update recreates that directory and promptly fails with the same error message.
I re-installed ruby 1.9.8 with gems several times to try to cure the problem, then upgraded to ruby 2.0.0. Throughout all re-installs and upgrades, the problem persisted.
I'm at my wits end here. Can anyone help me resolve this issue?
Here's the backtrace on the edit"
L:\xampp\htdocs\frameworks\yii2\framework>gem update --backtrace
Updating installed gems
ERROR: While executing gem ... (Gem::Exception)
Invalid spec cache file in C:/Users/Larry/.gem/specs/rubygems.org%443/specs.4.8
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:187:in `rescue in load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source.rb:179:in `load_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:266:in `tuples_for'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:228:in `block in available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/source_list.rb:97:in `each_source'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:222:in `available_specs'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:102:in `search_for_dependency'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:113:in `fetch_remote_gems'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:135:in `highest_remote_version'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:264:in `block in which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `each'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:260:in `which_to_update'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/commands/update_command.rb:96:in `execute'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:305:in `invoke_with_build_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:167:in `process_args'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:137:in `run'
C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:54:in `run'
C:/Ruby200-x64/bin/gem:21:in `<main>'
I had the same problem, but was able to fix it this way:
Delete the folder in users/%user%/.gem/ and rerun the command gem sources --update
Hope this helps.
I’m a freshman on Ruby and now trying to install ruby on my machine according to the Tutorial on http://wiki.openqa.org/display/WTR/Tutorial
However, after I installed the ruby186-26, and run the command “gem update --system”, the following error occurred:
C:\Documents and Settings\e482090\Desktop>gem update --system
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initialize': Inval
id argument - <Not Set>/.gemrc (Errno::EINVAL)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `open'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initi
alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `new'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `do_con
figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from c:/ruby/bin/gem:23
C:\Documents and Settings\e482090\Desktop>gem install watir
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initialize': Inval
id argument - <Not Set>/.gemrc (Errno::EINVAL)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `open'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:51:in `initi
alize' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `new'
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:36:in `do_con
figuration' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/gem_runner.rb:25:in `run'
from c:/ruby/bin/gem:23
Meanwhile, we have tried this on other machines and the result turned out ok.
Thus, my question is why the error happened on my pc? Have you met this kind of error before?
this is caused by the version of ruby you are trying to install, which included an outdated version of rubygems that cannot auto-update itself.
since you are trying to install ruby on a windows machine, you need to get the installer from
http://rubyinstaller.org
get the latest patch release of whatever version you need - there is a 1.8.6, 1.8.7, and 1.9.1 installer available.
once you have installed the right version from this site, you will be able to run gem update --system without any issues.
Execute Below command and its works
gem install hpricot --platform=mswin32