I am having an issue connecting to the server using the shotgun GEM in ruby. Here is the error I get.
Can someone identify the issue here? Is it with the command I typed, or possibly something else? I have previously had issues with attempting to install the Ruby Bundle to run this lab. I had had assistance in troubleshooting that issue, but there still seems to be a possible issue with the GEM.
Antonio#MacBook-Pro sinatra-shotgun-server % rackup app.rb
Traceback (most recent call last):
22: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in <main>' 21: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/ruby_executable_hooks:24:in eval'
20: from /Users/Antonio/.rvm/gems/ruby-2.6.1/bin/rackup:23:in <main>' 19: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:297:in activate_bin_path'
18: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:297:in synchronize' 17: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:299:in block in activate_bin_path'
16: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems.rb:236:in finish_resolve' 15: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/request_set.rb:435:in resolve_current'
14: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/request_set.rb:423:in resolve' 13: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:192:in resolve'
12: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:42:in resolve' 11: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:64:in resolve'
10: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:106:in start_resolution' 9: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:165:in initial_state'
8: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:51:in sort_dependencies' 7: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:69:in with_no_such_dependency_error_handling'
6: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:52:in block in sort_dependencies' 5: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in sort_dependencies'
4: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in with_index' 3: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in sort_by'
2: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:279:in each' 1: from /Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:285:in block in sort_dependencies'
/Users/Antonio/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/resolver.rb:235:in `search_for': Unable to resolve dependency: user requested 'did_you_mean (= 1.3.0)' (Gem::UnsatisfiableDependencyError)
Antonio#MacBook-Pro sinatra-shotgun-server %
Related
I am trying to spin up EC2 with a vagrant AWS provider . I have following Vagrantfile
# Require the AWS provider plugin
require 'vagrant-aws'
# Create and configure the AWS instance(s)
Vagrant.configure('2') do |config|
# Use dummy AWS box
config.vm.box = 'aws-dummy'
# Specify AWS provider configuration
config.vm.provider 'aws' do |aws, override|
# Read AWS authentication information from environment variables
aws.access_key_id = ENV['AWS_ACCESS_KEY_ID']
aws.secret_access_key = ENV['AWS_SECRET_ACCESS_KEY']
# Specify SSH keypair to use
aws.keypair_name = 'AWS_KEY_PAIR'
# Specify region, AMI ID, and security group(s)
aws.region = 'us-east-1'
aws.ami = 'ami-0149b2da6ceec4bb0'
aws.security_groups = ['ENDHOSTS-SG']
# Specify username and private key path
override.ssh.username = 'ubuntu'
override.ssh.private_key_path = '~/.ssh/key_pair_zhajili_AWS.pem'
end
end
But unfortunately, I am receiving the following error
\King Julien$ vagrant up --provider=aws
There are errors in the configuration of this machine. Please fix
the following errors and try again:
\King Julien$ vagrant up --provider=aws
Traceback (most recent call last):
25: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/bin/vagrant:248:in `<main>'
24: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/environment.rb:301:in `cli'
23: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/cli.rb:67:in `execute'
22: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/plugins/commands/up/command.rb:87:in `execute'
21: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/plugin/v2/command.rb:186:in `with_target_vms'
20: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/plugin/v2/command.rb:186:in `each'
19: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/plugin/v2/command.rb:204:in `block in with_target_vms'
18: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/plugin/v2/command.rb:180:in `block in with_target_vms'
17: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/environment.rb:740:in `machine'
16: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/vagrantfile.rb:83:in `machine'
15: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/vagrantfile.rb:83:in `new'
14: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:156:in `initialize'
13: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:543:in `state'
12: from /Users/zhajili/.vagrant.d/gems/2.7.6/gems/vagrant-aws-0.7.2/lib/vagrant-aws/provider.rb:32:in `state'
11: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:203:in `action'
10: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:199:in `block in action'
9: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:217:in `block in action'
8: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/machine.rb:248:in `action_raw'
7: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/runner.rb:101:in `run'
6: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/util/busy.rb:19:in `busy'
5: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/runner.rb:101:in `block in run'
4: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/builder.rb:180:in `call'
3: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/warden.rb:48:in `call'
2: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
1: from /opt/vagrant/embedded/gems/2.3.3/gems/vagrant-2.3.3/lib/vagrant/action/warden.rb:48:in `call'
/Users/zhajili/.vagrant.d/gems/2.7.6/gems/vagrant-aws-0.7.2/lib/vagrant-aws/action/connect_aws.rb:41:in `call': undefined method `except' for #<Hash:0x00007f7fa0a1a258> (NoMethodError)
I found the following discussion, but the workaround did not work for me .
https://github.com/mitchellh/vagrant-aws/issues/566
I have the following installed software
Vagrant 2.3.3
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin22]
I am going through local authenticator example and at step 14, after I press 'Authorize', getting exception
[2021-02-02 18:13:41,087] [0528806c-f8f8-4df5-abca-5f47c3972b24] ERROR
{org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/authenticationendpoint].
[default]} - Servlet.service() for servlet [default] in context with path
[/authenticationendpoint] threw exception [Unable to compile class for JSP:
An error occurred at line: [25] in the jsp file: [/includes/localize.jsp]
Duplicate local variable BUNDLE
22: <%# page import="java.nio.charset.StandardCharsets" %>
23: <%#page contentType="text/html; charset=UTF-8"%>
24: <%
25: String BUNDLE =
"org.wso2.carbon.identity.application.authentication.endpoint.i18n.Resources";
26: ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE, request.getLocale(),
new
27: EncodedControl(StandardCharsets.UTF_8.toString()));
28: %>
I am running WSO2 5.11 and Tomcat 7.0.107.
I need to use a higher version of aws-sdk than what lambda function provides by default. I am using serverless framework and webpack to build my serverless application. In serverless I can include or exclude dependencies in serverless.yml configuration:
package:
individually: true
include:
- node_modules/aws-sdk
So I can provide my own aws-sdk in the package. But in my webpack config I have this configuration:
externals: [
/aws-sdk/
],
which relies on aws-sdk on lambda container. When I remove this to not use the aws-sdk provided by lambda, I'm getting JavaScript heap out of memory error. What is the best way to accomplish this task?
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation
failed - JavaScript heap out of memory
1: 0x10003b125 node::Abort() [/usr/local/bin/node]
2: 0x10003b32f node::OnFatalError(char const*, char const*)
[/usr/local/bin/node]
3: 0x1001a8e85
v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char
const*, bool) [/usr/local/bin/node]
4: 0x1005742a2 v8::internal::Heap::FatalProcessOutOfMemory(char
const*) [/usr/local/bin/node]
5: 0x100576d75
v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double)
[/usr/local/bin/node]
6: 0x100572c1f
v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollect
.or, v8::GCCallbackFlags) [/usr/local/bin/node]
7: 0x100570df4 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
8: 0x10057d68c v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
9: 0x10057d70f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x10054f594 v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
11: 0x100681149 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/local/bin/node]
12: 0x1001c6c1d v8::String::Utf8Length() const [/usr/local/bin/node]
13: 0x10004eaac node::Buffer::(anonymous namespace)::ByteLengthUtf8(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
14: 0x10023170f v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo*) [/usr/local/bin/node]
15: 0x100230c51 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/bin/node]
16: 0x1002302f0 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
17: 0xddb29a5be3d
18: 0xddb29a118d5
Abort trap: 6
I am trying to install omniauth for sorcery. When I run:
rails g sorcery:install external --migrations
gsub config/initializers/sorcery.rb
Traceback (most recent call last):
24: from bin/rails:4:in <main>'
23: from bin/rails:4:inrequire'
22: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in <top (required)>'
21: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:inrun_command!'
20: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:50:in generate'
19: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:130:ingenerate_or_destroy'
18: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:123:in require_command!'
17: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:inrequire'
16: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:240:in load_dependency'
15: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:inblock in require'
14: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:in require'
13: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/commands/generate.rb:13:in'
12: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-4.2.10/lib/rails/generators.rb:157:in invoke'
11: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:466:instart'
10: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/group.rb:232:in dispatch'
9: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:ininvoke_all'
8: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in map'
7: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:ineach'
6: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in block in invoke_all'
5: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:ininvoke_command'
4: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in run'
3: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/sorcery-0.8.6/lib/generators/sorcery/install_generator.rb:31:inconfigure_initializer_file'
2: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:in gsub_file'
1: from /home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:inopen'
/home/david/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/actions/file_manipulation.rb:265:in `initialize': Permission denied # rb_sysopen - /home/david/geofly/config/initializers/sorcery.rb (Errno::EACCES)
I rolled back all migrations and deleted files in db/migrate.
Started fresh with sorcery install guide on wiki.
When migrating, I tried to overwrite files, which resulted in (Errno::EACCES), so I simply manualually deleted these files.
i ran rake db:drop, rake: db:create rake db:migrate.
The production database failed to drop, so I dropped it from termianl with mysql. So far the migrations are working and I successfully migrated SorceryExternal.
I want to use the environment_variables of an App to set some properties, but my instance keep failing at setup, reading the documentation (http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-events.html) I found this:
"Setup includes Deploy; it runs the Deploy recipes after setup is complete.".
This is part of my Deploy script
if node['deploy']['ws']['application'] && node['deploy']['ws']['environment_variables']['is_root_app'] == 'true'
web_app node['deploy']['ws']['application'] do
server_name node['fqdn']
server_aliases node['deploy']['ws']['domains']
template 'web_app.conf.erb'
docroot node.default['apache']['docroot_dir']
ssl_enabled node['deploy']['ws']['ssl_support']
enable true
end
end
This is the Setup log
NoMethodError
-------------
undefined method `[]' for nil:NilClass
Cookbook Trace:
---------------
/var/chef/runs/254b8caa-cd70-4525-a2fd-71044afdf62d/local-mode-cache/cache/cookbooks/WebService/recipes/deploy_app.rb:8:in `from_file'
Relevant File Content:
----------------------
/var/chef/runs/254b8caa-cd70-4525-a2fd-71044afdf62d/local-mode-cache/cache/cookbooks/WebService/recipes/deploy_app.rb:
1: #
2: # Cookbook Name:: WebService
3: # Recipe:: default
4: #
5: # Copyright (c) 2016 The Authors, All Rights Reserved.
6:
7:
8>> if node['deploy']['ws']['application'] && node['deploy']['ws']['environment_variables']['is_root_app'] == 'true'
9: web_app node['deploy']['ws']['application'] do
10: server_name node['fqdn']
11: server_aliases node['deploy']['ws']['domains']
12: template 'web_app.conf.erb'
13: docroot node.default['apache']['docroot_dir']
14: ssl_enabled node['deploy']['ws']['ssl_support']
15: enable true
16: end
17: else
Whats the purpose of running the Deploy recipes after Setup, if I didnt deployed any App yet??? Where the environment_variables can be used if not on the Deploy recipes???
Imagine you have everything set up and you just start a new machine. It will run setup, configure then deploy otherwise you would end up with an instance that's not ready for production.
deployment fails when you're trying to access attributes that aren't set
You can use http://ruby-doc.org/core-1.9.3/Hash.html#method-i-has_key-3F to check this
e.g.
if node[:deploy].has_key?("ws")
end
Same for your env variables