Chef-solo and cookbook_path: multiple paths are not woking - ruby

Contrary to the docs...in my solo.rb file the below does not work:
root = File.absolute_path(File.dirname(__FILE__))
cookbook_path [ root + "/cookbooks",root + "/site-cookbooks", root + "/berks-cookbooks" ]
This works but defeats the purpose because I need to add the other two dirs in the cookbook paths:
root = File.absolute_path(File.dirname(__FILE__))
cookbook_path root + "/cookbooks"
Below is a sample role
{
"name": "coordinator_do_server",
"environment":{"git_repos":[]},
"java":{ "install_flavor":"oracle","jdk_version":"7"},
"run_list": ["recipe[build-essential]"
]
}
Error I get is the below:
Starting Chef Client, version 11.14.2
================================================================================
Error expanding the run_list:
================================================================================
Unexpected Error:
-----------------
TypeError: can't convert Array into String
[2014-12-07T18:22:07+08:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 0 resources updated in 2.259210544 seconds
[2014-12-07T18:22:07+08:00] ERROR: can't convert Array into String
[2014-12-07T18:22:07+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
How do I resolve?
Generated at 2014-12-08 00:12:42 +0800
TypeError: can't convert Array into String
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/environment.rb:248:in `directory?'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/environment.rb:248:in `load_from_file'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/environment.rb:241:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/node.rb:380:in `apply_expansion_attributes'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/node.rb:369:in `expand!'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/policy_builder/expand_node_object.rb:135:in `expand_run_list'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/policy_builder/expand_node_object.rb:122:in `build_node'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:259:in `build_node'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:420:in `do_run'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:213:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:207:in `fork'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/client.rb:207:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application.rb:237:in `run_chef_client'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/solo.rb:226:in `block in run_application'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/solo.rb:218:in `loop'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application/solo.rb:218:in `run_application'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/lib/chef/application.rb:55:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-11.14.2/bin/chef-solo:25:in `<top (required)>'
/usr/local/bin/chef-solo:23:in `load'
/usr/local/bin/chef-solo:23:in `<main>'

The problem is that the chef_repo_path derives its default value from that of cookbook_path, and then the default environment_path is based on chef_repo_path. To fix this add chef_repo_path root to your config.

Related

bundle install always in Resolving dependencies progress

when I am using this command in macOS Catalina 10.15:
bundle install --verbose
shows this log output is:
$ bundle install --verbose
Running `bundle install --verbose` with bundler 2.2.3
Found changes from the lockfile, re-resolving dependencies because the list of sources changed, the dependencies in your gemfile changed, you added a new platform to your gemfile
HTTP GET https://gems.ruby-china.com/versions
HTTP 304 Not Modified https://gems.ruby-china.com/versions
Fetching gem metadata from https://gems.ruby-china.com/
Looking up gems ["xcode-install", "fastlane", "fastlane-plugin-pgyer"]
Looking up gems ["claide", "fastlane_core", "nokogiri", "spaceship", "capybara", "colored", "commander", "deliver", "highline", "json", "poltergeist", "security", "credentials_manager", "frameit", "pem", "shenzhen", "sigh", "snapshot", "produce", "slack-notifier", "hipchat", "cert", "aws-sdk", "xcodeproj", "terminal-notifier", "xcpretty", "cupertino", "terminal-table", "krausefx-shenzhen", "pbxplorer", "rest-client", "gym", "pilot", "plist", "addressable", "artifactory", "slather", "scan", "supply", "match", "screengrab", "multipart-post", "word_wrap", "bundler", "activesupport", "babosa", "dotenv", "excon", "faraday", "faraday-cookie_jar", "faraday_middleware", "fastimage", "gh_inspector", "google-api-client", "mini_magick", "multi_json", "multi_xml", "rubyzip", "xcpretty-travis-formatter", "colored2", "tty-screen", "commander-fastlane", "CFPropertyList", "public_suffix", "tty-spinner", "simctl", "emoji_regex", "bootsnap", "google-cloud-storage", "jwt", "aws-sdk-s3", "naturally"]
Looking up gems ["hoe", "weakling", "mini_portile", "mini_portile2", "pkg-config", "racc", "termios", "culerity", "database_cleaner", "rack", "selenium-webdriver", "rack-test", "mime-types", "celerity", "xpath", "mini_mime", "regexp_parser", "uglifier", "prawn", "phantomjs", "httparty", "mimemagic", "rake", "nanaimo", "atomos", "pry", "cookiejar", "sentry-raven", "em-websocket", "sfl", "faye-websocket", "http_parser.rb", "childprocess", "cliver", "websocket-driver", "net-sftp", "unicode-display_width", "uuidtools", "aws-sdk-v1", "aws-sdk-resources", "aws-sdk-acm", "aws-sdk-apigateway", "aws-sdk-applicationautoscaling", "aws-sdk-applicationdiscoveryservice", "aws-sdk-autoscaling", "aws-sdk-budgets", "aws-sdk-cloudformation", "aws-sdk-cloudfront", "aws-sdk-cloudhsm", "aws-sdk-cloudsearch", "aws-sdk-cloudsearchdomain", "aws-sdk-cloudtrail", "aws-sdk-cloudwatch", "aws-sdk-cloudwatchevents", "aws-sdk-cloudwatchlogs", "aws-sdk-codecommit", "aws-sdk-codedeploy", "aws-sdk-codepipeline", "aws-sdk-cognitoidentity", "aws-sdk-cognitoidentityprovider", "aws-sdk-cognitosync", "aws-sdk-configservice", "aws-sdk-databasemigrationservice", "aws-sdk-datapipeline", "aws-sdk-devicefarm", "aws-sdk-directconnect", "aws-sdk-directoryservice", "aws-sdk-dynamodb", "aws-sdk-dynamodbstreams", "aws-sdk-ec2", "aws-sdk-ecr", "aws-sdk-ecs", "aws-sdk-efs", "aws-sdk-elasticache", "aws-sdk-elasticbeanstalk", "aws-sdk-elasticloadbalancing", "aws-sdk-elasticloadbalancingv2", "aws-sdk-elasticsearchservice", "aws-sdk-elastictranscoder", "aws-sdk-emr", "aws-sdk-firehose", "aws-sdk-gamelift", "aws-sdk-glacier", "aws-sdk-iam", "aws-sdk-importexport", "aws-sdk-inspector", "aws-sdk-iot", "aws-sdk-iotdataplane", "aws-sdk-kinesis", "aws-sdk-kinesisanalytics", "aws-sdk-kms", "aws-sdk-lambda", "aws-sdk-lambdapreview", "aws-sdk-machinelearning", "aws-sdk-marketplacecommerceanalytics", "aws-sdk-marketplacemetering", "aws-sdk-opsworks", "aws-sdk-rds", "aws-sdk-redshift", "aws-sdk-route53", "aws-sdk-route53domains", "aws-sdk-servicecatalog", "aws-sdk-ses", "aws-sdk-simpledb", "aws-sdk-sms", "aws-sdk-snowball", "aws-sdk-sns", "aws-sdk-sqs", "aws-sdk-ssm", "aws-sdk-storagegateway", "aws-sdk-support", "aws-sdk-swf", "aws-sdk-waf", "aws-sdk-workspaces", "aws-sdk-appstream", "aws-sdk-codebuild", "aws-sdk-health", "aws-sdk-lightsail", "aws-sdk-opsworkscm", "aws-sdk-pinpoint", "aws-sdk-polly", "aws-sdk-rekognition", "aws-sdk-sfn", "aws-sdk-shield", "aws-sdk-wafregional", "aws-sdk-xray", "aws-sdk-batch", "aws-sdk-clouddirectory", "aws-sdk-costandusagereportservice", "aws-sdk-lexruntimeservice", "aws-sdk-mturk", "aws-sdk-organizations", "aws-sdk-workdocs", "aws-sdk-codestar", "aws-sdk-lexmodelbuildingservice", "aws-sdk-resourcegroupstaggingapi", "aws-sdk-lex", "aws-sdk-marketplaceentitlementservice", "aws-sdk-states", "aws-sdk-athena", "paint", "rouge", "rspec", "httpclient", "i18n", "mechanize", "term-ansicolor", "netrc", "certified", "rdoc", "ffi", "http-cookie", "http-accept", "builder", "memcache-client", "tzinfo", "minitest", "thread_safe", "concurrent-ruby", "method_source", "zeitwerk", "clamp", "extlib", "httpadapter", "signet", "launchy", "liquid", "sinatra", "autoparse", "retriable", "googleauth", "hurley", "memoist", "representable", "thor", "virtus", "rexml", "google-apis-core", "google-apis-generator", "hashie", "oauth2", "roauth", "dotenv-deployment", "subexec", "ruby2_keywords", "faraday-net_http", "tty-cursor", "digest-crc", "google-cloud-core", "google-apis-iamcredentials_v1", "google-apis-storage_v1", "libxml-ruby", "aws-sdk-core", "aws-sigv4", "msgpack", "snappy"]
Looking up gems ["rubyforge", "RubyInline", "gemcutter", "mime-types-data", "cucumber", "therubyracer", "execjs", "prawn-layout", "prawn-core", "prawn-format", "prawn-security", "pdf-reader", "ttfunk", "afm", "ruby-rc4", "pdf-core", "jnunemaker-crack", "crack", "json_pure", "libwebsocket", "websocket", "database_cleaner-active_record", "eventmachine", "websocket-extensions", "ruby_parser", "coderay", "win32console", "yard", "slop", "spoon", "yajl-ruby", "certifi", "net-ssh", "thin", "aws-sdk-dax", "aws-sdk-greengrass", "aws-sdk-cloudhsmv2", "aws-sdk-glue", "aws-sdk-migrationhub", "aws-sdk-mobile", "aws-sdk-pricing", "aws-sdk-costexplorer", "aws-sdk-mediaconvert", "aws-sdk-medialive", "aws-sdk-mediapackage", "aws-sdk-mediastore", "aws-sdk-mediastoredata", "aws-sdk-appsync", "aws-sdk-guardduty", "aws-sdk-mq", "aws-sdk-comprehend", "aws-sdk-iotjobsdataplane", "aws-sdk-kinesisvideo", "aws-sdk-kinesisvideoarchivedmedia", "aws-sdk-kinesisvideomedia", "aws-sdk-sagemaker", "aws-sdk-sagemakerruntime", "aws-sdk-translate", "aws-sdk-resourcegroups", "aws-sdk-alexaforbusiness", "aws-sdk-cloud9", "aws-sdk-serverlessapplicationrepository", "aws-sdk-servicediscovery", "aws-sdk-workmail", "aws-sdk-autoscalingplans", "aws-sdk-transcribeservice", "aws-sdk-connect", "aws-sdk-acmpca", "aws-sdk-fms", "aws-sdk-secretsmanager", "aws-sdk-iotanalytics", "aws-sdk-iot1clickdevicesservice", "aws-sdk-iot1clickprojects", "aws-sdk-pi", "aws-sdk-neptune", "aws-sdk-mediatailor", "aws-sdk-eks", "aws-sdk-macie", "aws-sdk-dlm", "aws-sdk-signer", "aws-sdk-chime", "aws-sdk-pinpointemail", "aws-sdk-pinpointsmsvoice", "aws-sdk-ram", "aws-sdk-route53resolver", "aws-sdk-s3control", "aws-sdk-quicksight", "aws-sdk-rdsdataservice", "aws-sdk-amplify", "aws-sdk-datasync", "aws-sdk-robomaker", "aws-sdk-transfer", "aws-sdk-globalaccelerator", "aws-sdk-comprehendmedical", "aws-sdk-kinesisanalyticsv2", "aws-sdk-mediaconnect", "aws-sdk-fsx", "aws-sdk-securityhub", "aws-sdk-appmesh", "aws-sdk-licensemanager", "aws-sdk-kafka", "aws-sdk-apigatewaymanagementapi", "aws-sdk-apigatewayv2", "aws-sdk-docdb", "aws-sdk-backup", "aws-sdk-worklink", "aws-sdk-textract", "aws-sdk-transcribestreamingservice", "aws-sdk-managedblockchain", "aws-sdk-mediapackagevod", "aws-sdk-groundstation", "aws-sdk-iotthingsgraph", "aws-sdk-iotevents", "aws-sdk-ioteventsdata", "aws-sdk-personalize", "aws-sdk-personalizeevents", "aws-sdk-personalizeruntime", "aws-sdk-applicationinsights", "aws-sdk-servicequotas", "aws-sdk-ec2instanceconnect", "aws-sdk-eventbridge", "aws-sdk-lakeformation", "aws-sdk-forecastqueryservice", "aws-sdk-forecastservice", "aws-sdk-qldb", "aws-sdk-qldbsession", "aws-sdk-workmailmessageflow", "aws-sdk-codestarnotifications", "aws-sdk-savingsplans", "aws-sdk-sso", "aws-sdk-ssooidc", "aws-sdk-marketplacecatalog", "aws-sdk-dataexchange", "aws-sdk-sesv2", "aws-sdk-migrationhubconfig", "aws-sdk-connectparticipant", "aws-sdk-appconfig", "aws-sdk-iotsecuretunneling", "aws-sdk-wafv2", "aws-sdk-elasticinference", "aws-sdk-imagebuilder", "aws-sdk-schemas", "aws-sdk-accessanalyzer", "aws-sdk-augmentedairuntime", "aws-sdk-codeguruprofiler", "aws-sdk-codegurureviewer", "aws-sdk-computeoptimizer", "aws-sdk-frauddetector", "aws-sdk-kendra", "aws-sdk-networkmanager", "aws-sdk-outposts", "aws-sdk-ebs", "aws-sdk-kinesisvideosignalingchannels", "aws-sdk-detective", "aws-sdk-codestarconnections", "aws-sdk-synthetics", "aws-sdk-iotsitewise", "aws-sdk-macie2", "aws-sdk-codeartifact", "aws-sdk-honeycode", "aws-sdk-ivs", "aws-sdk-braket", "aws-sdk-identitystore", "aws-sdk-appflow", "aws-sdk-redshiftdataapiservice", "aws-sdk-ssoadmin", "aws-sdk-timestreamquery", "aws-sdk-timestreamwrite", "aws-sdk-s3outposts", "aws-sdk-gluedatabrew", "aws-sdk-appregistry", "aws-sdk-networkfirewall", "aws-sdk-mwaa", "aws-sdk-amplifybackend", "aws-sdk-appintegrationsservice", "aws-sdk-connectcontactlens", "aws-sdk-devopsguru", "aws-sdk-ecrpublic", "aws-sdk-lookoutforvision", "aws-sdk-profile", "aws-sdk-sagemakerfeaturestoreruntime", "aws-sdk-customerprofiles", "aws-sdk-auditmanager", "aws-sdk-emrcontainers", "aws-sdk-healthlake", "aws-sdk-sagemakeredgemanager", "aws-sdk-greengrassv2", "aws-sdk-iotdeviceadvisor", "aws-sdk-iotfleethub", "aws-sdk-iotwireless", "aws-sdk-prometheusservice", "aws-sdk-locationservice", "aws-sdk-wellarchitected", "aws-sdk-lexmodelsv2", "aws-sdk-lexruntimev2", "aws-sigv2", "rspec-core", "rspec-expectations", "rspec-mocks", "hpricot", "ruby-web", "narf", "net-http-persistent", "net-http-digest_auth", "webrobots", "domain_name", "ntlm-http", "webrick", "tins", "sqlite3", "atomic", "english", "functional-ruby", "ref", "ZenTest", "logging", "os", "configuration", "mongrel", "tilt", "rack-protection", "backports", "mustermann", "hooks", "uber", "declarative", "declarative-option", "descendants_tracker", "axiom-types", "coercible", "equalizer", "gems", "google-apis-discovery_v1", "faraday-middleware", "httpauth", "google-cloud-env", "google-cloud-errors", "snappy-jars", "jamespath", "jmespath", "aws-partitions", "aws-eventstream", "http-2"]
Looking up gems ["net-scp", "Ascii85", "hashery", "spruz", "ParseTree", "sexp_processor", "diff-lcs", "polyglot", "treetop", "gherkin", "multi_test", "cucumber-core", "gherkin3", "cucumber-wire", "event-bus", "cucumber-expressions", "cucumber-formatter-dots", "cucumber-gherkin", "cucumber-html-formatter", "cucumber-cucumber-expressions", "cucumber-messages", "sys-uname", "cucumber-create-meta", "libv8", "safe_yaml", "needle", "jruby-pageant", "bcrypt_pbkdf", "rbnacl", "rbnacl-libsodium", "activerecord", "database_cleaner-core", "erubis", "daemons", "rspec-support", "connection_pool", "unf", "sync", "ice_nine", "tool", "flexmock", "lockfile", "little-plugger", "cgi_multipart_eof_fix", "fastthread", "gem_plugin", "rash", "escape_utils", "adamantium"]
Looking up gems ["blankslate", "trollop", "c21e", "SexpProcessor", "facets", "cucumber-tag_expressions", "cucumber-tag-expressions", "psych", "google-protobuf", "protobuf-cucumber", "abstract", "unf_ext", "activemodel", "arel", "activerecord-deprecated_finders", "memoizable"]
Looking up gems ["curses", "middleware", "bcrypt-ruby", "jar-dependencies"]
Looking up gems ["bcrypt", "ruby-maven"]
Looking up gems ["maven-tools", "ruby-maven-libs"]
Double checking for ["bundler"] in rubygems repository https://rubygems.org/ or installed locally
Fetching gem metadata from https://gems.ruby-china.com/
Looking up gems ["bundler"]
Resolving dependencies........................................................................................................................................................................
what exactly Resolving dependencies do? why the Resolving dependencies running for hours? how to known the progress of Resolving dependencies? what should I do to fix it?
this is my Gemfile(I have changed the source to china because the GFW but still not work):
source "https://gems.ruby-china.com"
gem "xcode-install"
gem "fastlane"
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
when I interrupt the install:
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................^C
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/shared_helpers.rb:158:in `block in trap'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/shared_helpers.rb:158:in `block in trap'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:504:in `=='
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:504:in `=='
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:504:in `include?'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:504:in `block in filter_possibilities_for_parent_unwind'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:503:in `reject!'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:503:in `filter_possibilities_for_parent_unwind'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:445:in `filter_possibilities_after_unwind'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:303:in `block in unwind_for_conflict'
<internal:kernel>:90:in `tap'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:257:in `process_topmost_state'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolution.rb:182:in `resolve'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/molinillo/lib/molinillo/resolver.rb:43:in `resolve'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/resolver.rb:50:in `start'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/resolver.rb:22:in `resolve'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/definition.rb:273:in `resolve'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/definition.rb:175:in `specs'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/definition.rb:163:in `resolve_remotely!'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/installer.rb:306:in `resolve_if_needed'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/installer.rb:83:in `block in run'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/process_lock.rb:12:in `block in lock'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/process_lock.rb:9:in `open'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/process_lock.rb:9:in `lock'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/installer.rb:72:in `run'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/installer.rb:24:in `install'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/cli/install.rb:64:in `run'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/cli.rb:262:in `block in install'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/settings.rb:115:in `temporary'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/cli.rb:261:in `install'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/libexec/bundle:49:in `block in <top (required)>'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/3.0.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/libexec/bundle:37:in `<top (required)>'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/bin/bundle:23:in `load'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/bin/bundle:23:in `<main>'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/bin/ruby_executable_hooks:22:in `eval'
/Users/dolphin/.rvm/rubies/ruby-3.0.0/bin/ruby_executable_hooks:22:in `<main>'
(base)
seems blocked for some reason.
Delete gemfile.lock and run bundle install, it will work.

On Heroku I got FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: )

The code is:
tempfile = Tempfile.open('content')
tempfile.write(content)
movie = FFMPEG::Movie.new(tempfile.path)
screenshot_temp_file = Tempfile.open('screenshot')
movie.screenshot(screenshot_temp_file.path)
everything works fine locally, but when I try this on Heroku I got error at last row:
irb(main):013:0> movie.screenshot(screenshot_temp_file.path)
I, [2020-10-07T15:48:27.132114 #7] INFO -- : Running transcoding...
["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]
E, [2020-10-07T15:48:27.190572 #7] ERROR -- : Failed encoding...
["/app/vendor/ffmpeg/ffmpeg", "-y", "-i", "/tmp/content20201007-7-1g1955b", "-vframes", "1", "-f", "image2", "/tmp/screenshot20201007-7-1mmts7s"]
Errors: encoded file is invalid.
Traceback (most recent call last):
7: from /app/bin/irb:30:in `<main>'
6: from /app/bin/irb:30:in `load'
5: from /app/vendor/ruby-2.6.6/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
4: from (irb):13
3: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/movie.rb:204:in `screenshot'
2: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:45:in `run'
1: from /app/vendor/bundle/ruby/2.6.0/gems/streamio-ffmpeg-3.0.2/lib/ffmpeg/transcoder.rb:112:in `validate_output_file'
FFMPEG::Error (Failed encoding.Errors: encoded file is invalid. Full output: )
I've try to pass some options, like :seek_time and validate: false but nothing changed. What am I doing wrong? Thank you so much!
EDIT:
After Full output: ) there is nothing.
I've install FFMPEG buildpack on Heroku, and can see it in ui:

Mongo Ruby Driver Cursor not found error

I find documents from mongodb using ruby driver, collect them to array and iterate on them to update the same document as in the code below:
crawlarray = ##mongoclient[:crawlarray].find({searchresults:[]},:timeout => false).limit(500)
crawlarray.each do |elm|
finalsearchstring = elm['searchstring']
if elm["searchresults"].blank?
ap "SEARCHING: #{finalsearchstring}"
results = searchG(finalsearchstring)
elm["searchresults"] = results
##mongoclient[:crawlarray].update_one({"_id" => elm['_id']}, elm)
else
ap "ALREADY SEARCHED: #{finalsearchstring}"
end
end
There are 90K records but as you see I just get 500 to not to get the error.Everytime, after about 150 iterations I get this error;
D, [2016-08-02T22:32:08.853065 #10098] DEBUG -- : MONGODB | 127.0.0.1:27017 | posluga-dev.getMore | FAILED | Cursor not found, cursor id: 463388278686 (43) | 0.008009s
/Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/operation/result.rb:256:in `validate!': Cursor not found, cursor id: 463388278686 (43) (Mongo::Error::OperationFailure)
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/operation/executable.rb:36:in `block in execute'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/server/connection_pool.rb:107:in `with_connection'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/server/context.rb:63:in `with_connection'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/operation/executable.rb:34:in `execute'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/cursor.rb:163:in `block in get_more'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/retryable.rb:51:in `call'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/retryable.rb:51:in `read_with_retry'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/cursor.rb:162:in `get_more'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/cursor.rb:88:in `each'
from /Users/apple/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.7/lib/mongo/collection/view/iterable.rb:44:in `each'
Can anybody help me to sort it out?
Use 'no_cursor_timeout' option along with the find query while using Mongo Ruby Driver.
This will disable all cursor timeouts. By default MongoDB tries to kill all cursors which have been inactive for more than 10 mins.
For more information, check this post.

peatio: what is default password for database.yml?

I just tried to install peatio and I see that password is empty in peatio/config/database.yml
what should be written there?
here is screenshot: http://s14.postimg.org/4ijmxjwtt/untitled.png
here is my error from terminal when I tried to start server:
bundle exec rails server
/usr/local/lib/ruby/2.1.0/psych.rb:370:in `parse': (): did
not find expected key while parsing a block mapping at line 6 column 3
(Psych::SyntaxError)
edited, here is full error:
from /usr/local/lib/ruby/2.1.0/psych.rb:370:in parse_stream'
from /usr/local/lib/ruby/2.1.0/psych.rb:318:inparse'
from /usr/local/lib/ruby/2.1.0/psych.rb:245:in load'
from /usr/local/lib/ruby/gems/2.1.0/gems/figaro-0.7.0/lib/figaro.rb:21:i
from /usr/local/lib/ruby/gems/2.1.0/gems/figaro-0.7.0/lib/figaro.rb:17:i
from /usr/local/lib/ruby/gems/2.1.0/gems/figaro-0.7.0/lib/figaro/railtie
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/lib/active_
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/lib/active_
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/lib/active_
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/lib/active_
from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/lib/active_
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.2/lib/rails/applic
from /peatio/config/application.rb:16:in'
from /peatio/config/application.rb:15:in <top (required)>'
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.2/lib/rails/comman
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.2/lib/rails/comman
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.2/lib/rails/comman
from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.2/lib/rails/comman
from bin/rails:4:inrequire'
from bin/rails:4:in `'
Peatio default password for user admin#barong.io is Qwerty123 or Chah5YohWm

I get these errors trying to build a web service client in Ruby

I am trying to build a web service client in Ruby.
When I try to invoke the following soap4r ruby script to generate web service client code:
wsdl2ruby.rb --wsdl *[web_service_url]* --type client
I get the following error:
ignored attr: {http://www.w3.org/2006/05/addressing/wsdl}Action
I, [2011-06-09T17:16:01.012268 #10104] INFO -- app: Creating class definition.
I, [2011-06-09T17:16:01.012268 #10104] INFO -- app: Creates file 'SessionServic
e.rb'.
F, [2011-06-09T17:16:01.014268 #10104] FATAL -- app: Detected an exception. Stop
ping ... undefined method collect' for #<String:0x32260c8> (NoMethodError)
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb:2
39:intrim_eol'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/gensupport.rb:2
27:in format'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/commentdef.rb:2
7:indump_comment'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/xsd/codegen/classdef.rb:51:
in dump'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:118:inblock in dump_complextype'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:116:in collect'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:116:indump_complextype'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/classDefCreator.r
b:60:in dump'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:77:i
nblock in create_classdef'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:171:
in block in write_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:
inopen'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:170:
in write_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:76:i
ncreate_classdef'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:62:i
n create_file'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/soap/wsdl2ruby.rb:42:i
nrun'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/bin/wsdl2ruby.rb:46:in run'
C:/Ruby192/lib/ruby/1.9.1/logger.rb:691:instart'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/bin/wsdl2ruby.rb:137:in <top (
required)>'
C:/Ruby192/bin/wsdl2ruby.rb:19:inload'
C:/Ruby192/bin/wsdl2ruby.rb:19:in `'
I, [2011-06-09T17:16:01.016268 #10104] INFO -- app: End of app. (status: -1)
When, I try to invoke the following code to dynamically generate the web service client:
require 'soap/wsdlDriver'
WSDL_URL = "http://*[web_service_url]*"
factory = SOAP::WSDLDriverFactory.new(WSDL_URL)
driver = factory.create_rpc_driver
I get the following error:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in initialize': The requested service
provider could not be loaded or
initialized. - socket(2)
(http://*web_service_url*) (Errno::E10106)
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:innew' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in create_socket' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:705:inblock in connect' from
C:/Ruby192/lib/ruby/1.9.1/timeout.rb:57:in
timeout' from
C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in
timeout' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:704:in connect' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:568:inquery' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:158:in query' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:1057:in
do_get_block' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:866:in
block in do_request' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:953:in
protect_keep_alive_disconnected'
from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:865:in
do_request' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:938:in
follow_redirect' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:577:in
get_content' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:73:in
fetch' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:36:in
import' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:in
import' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:146:in
import' from
C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:32:in
initialize' from
C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in
new' from
C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in
'
When I try to invoke the same code above, but with the a different URL (the production URL instead of the test environment URL), I get a different error:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in initialize': getaddrinfo: A non-recoverable error occurred during a database lookup. (https://[prod_url]:443) (SocketError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:innew'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:748:in create_socket'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:705:inblock in connect'
from C:/Ruby192/lib/ruby/1.9.1/timeout.rb:57:in timeout'
from C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:intimeout'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:704:in connect'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:568:inquery'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient/session.rb:158:in query'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:1057:indo_get_block'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:866:in block in do_request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:953:inprotect_keep_alive_disconnected'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:865:in do_request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:938:infollow_redirect'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/httpclient-2.2.1/lib/httpclient.rb:577:in get_content'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:73:infetch'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/xmlSchema/importer.rb:36:in import'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/wsdl/importer.rb:18:inimport'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:146:in import'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/soap4r-1.5.8/lib/soap/wsdlDriver.rb:32:ininitialize'
from C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in new'
from C:/DevProjects/application-development-environment/UwsSampleRuby/blah.rb:6:in'
Why am I getting these errors, and how do I work around them? I know the web services are up and working, since I'm able to build web service clients in C# .Net just fine.
soap4r has a number of known issues with Ruby 1.9. You should consider using one of the newer SOAP toolkits, such as savon or handsoap.

Resources