all
Configure the echo service in cloudfoundry, the echo_gateway output console started as follows
[2013-03-07 09:53:56.135519] echo_gateway - pid=25534 tid=a837 fid=d765
FATAL -- Hostname not supplied: 'api.vcap.me/services/v1/offerings' ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/addressable-2.2.8/lib/addressable/uri.rb:2253:in `validate'|
ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/addressable-2.2.8/lib/addressable/uri.rb:1193:in `port='|
ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/em-http-request-1.0.0.beta.3/lib/em-http/http_options.rb:41:in `set_uri'|
ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/em-http-request-1.0.0.beta.3/lib/em-http/http_options.rb:8:in `initialize'|
ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/em-http-request-1.0.0.beta.3/lib/em-http/request.rb:7:in `new'|
ruby-1.9.2-p180/lib/ruby/gems/1.9.1/ruby/1.9.1/gems/em-http-request-1.0.0.beta.3/lib/em-http/request.rb:7:in `new'|
/home/zhangyunpeng/cloudfoundry/vcap/services/echo/vendor/cache/vcap-services-base-0346efd96d31/lib/base/catalog_manager_base.rb:24:in `create_http_request'|
/home/zhangyunpeng/cloudfoundry/vcap/services/echo/vendor/cache/vcap-services-base-0346efd96d31/lib/base/catalog_manager_v1.rb:130:in `advertise_service_to_cc'|
/home/zhangyunpeng/cloudfoundry/vcap/services/echo/vendor/cache/vcap-services-base-0346efd96d31/lib/base/catalog_manager_v1.rb:56:in `block (2 levels) in update_catalog'|
/home/zhangyunpeng/cloudfoundry/vcap/services/echo/vendor/cache/vcap-services-base-0346efd96d31/lib/base/catalog_manager_v1.rb:55:in `each'|
/home/zhangyunpeng/cloudfoundry/vcap/services/echo/vendor/cache/vcap-services-base-0346efd96d31/lib/base/catalog_manager_v1.rb:55:in `block in update_catalog'
In VMC, by VMC info --services, echo services option cannot be listed.
I think it is related to my Vcap environment, because of the same code, in colleagues can be.
I would recommend you to take a look at here: http://support.cloudfoundry.com/entries/20485171-How-to-Add-a-System-Service-to-OSS-Cloud-Foundry-Step-by-Step-guide.
Related
I am trying to generate war file using warbler for jruby, but i got stuck and i am getting this error:
warble aborted!
NoMethodError: undefined method `booter=' for nil:NilClass
config/warble.rb:9:in `block in initialize' /Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/config.rb:216:in `initialize'
config/warble.rb:4:in `<eval>'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/task.rb:46:in `initialize'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:27:in `load_rakefile'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:79:in `run'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/lib/warbler/application.rb:74:in `run'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/gems/warbler-2.0.4/bin/warble:11:in `<top>'
/Users/xxx/.rvm/gems/jruby-9.0.5.0/bin/warble:23:in `<top>'
(See full trace by running task with --trace)
my config file in config/warble.rb:
Warbler::Config.new do |config|
config.dirs = %w(app config views)
config.gems += ["sinatra"]
config.gems -= ["rails"]
config.jar_name = "jsinatra"
config.webxml.booter = :rack
config.webxml.jruby.compat.version = "1.9"
config.webxml.rackup.path = '/WEB-INF/config.ru'
end
any help, advice apricciated. thank you.
over all, i am trying to create docker container and i am using pdf file as a reference but the pdf is somehow vaguely written.
http://www.ibm.com/developerworks/cloud/library/cl-sinatra-softlayer-app/cl-sinatra-softlayer-app-pdf.pdf
Worked for me
In the pdf I posted there is file named rackup.ru with this contents:
require "sinatra"
require File.dirname(__FILE__) + '/app/main'
run MyApp
After hours of googling, I decided to create identical file and name it config.ru. Worked.
Not working
I have also tried to change
config.webxml.rackup.path = '/WEB-INF/config.ru'
to
config.webxml.rackup.path = '/WEB-INF/rackup.ru'
Did not work.
I have a Rakefile defined with code like so:
namespace :app do |args|
desc "Run App tests from lib/app_tests/test_*.rb"
Rake::TestTask.new do |t,args|
t.name = "testApp"
t.libs << 'lib/pageobjects/app_page_objects'
t.test_files = FileList['lib/app_tests/test_*.rb']
#t.options - passing on command line see below
t.verbose = true
end
...
But, when I run the task, it treats the TESTOPTS args as if they are additional tests that the test runner wants to run. What I want is for each test in t.test_files, pass the 3 arguments to each test. The main error I see is:
cannot load such file -- c:/Users/me/IdeaProjects/impl/util/PROJECT/testclient
Why is Rake treating my TESTOPTS like they are additional items in the t.test_files FileList object? With my experience with JUnit, this seems unusual to me.
And here is the console output:
$ rake app:testapp TESTOPTS="testclient impdev app"
c:/Ruby22-x64/bin/ruby.exe -I"lib;lib/pageobjects/app_page_objects" "c:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader.rb" "lib/app_tests/test_1.rb" "lib/app_tests/test_2.rb" testclient impdev app
Current dir is : c:/Users/me/IdeaProjects/impl/util/PROJECT
c:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- c:/Users/me/IdeaProjects/impl/util/PROJECT/testclient (LoadError)
from c:/Ruby22-x64/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from c:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader.rb:15:in `block in <main>'
from c:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `select'
from c:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib;lib/pageobjects/app_page_objects" "c:/Ruby22-x64/lib/ruby/2.2.0/rake/rake_test_loader.rb"
"lib/app_tests/test_browse_conditions.rb" "lib/app_tests/test_example.rb" testclient impdev app]
end
EDIT:
I created a test project on GitHub that reproduces the problem. Just download the project and run the tests with 'rake test' :
https://github.com/djangofan/RakeUnitTests/tree/5df4825d105251c81d425d3aef986e3f7d2f9f44
Also, I discovered that parallel_test (without rake) is capable of passing the test args the way that I want to, with a '-o' argument. I just wish I knew how to do it with Rake.
After updating a project to Rspec 3, I get the following strange errors in my tests which I am not able to fix:
undefined method `empty?' for 2:Fixnum
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:251:in `block in missing_keys'
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:251:in `select'
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:251:in `missing_keys'
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:231:in `optimized_helper'
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:220:in `call'
# /opt/local/lib/ruby2.1/gems/2.1.0/gems/actionpack-4.2.1/lib/action_dispatch/routing/route_set.rb:345:in `block (2 levels) in define_url_helper'
# ./app/controllers/users_controller.rb:10:in `block in <class:UsersController>'
users_controller line 10 contains a redirect:
redirect_to(user_path(current_user))
In each of these cases, current_user is a mocked User object created using mock_model(User, login: User.make_token) and has the ID value quoted in the error message (before ":Fixnum").
This happens with every redirect that contains an object. Examples:
redirect_to current_user
redirect_to user_path(current_user)
redirect_to url_for([:admin, current_user, :edit])
If I use the object's ID as in redirect_to user_path(current_user.id)), the error does not occur. However, then e.g. url_for breaks as well, since I cannot use url_for([#parent.id, #object.id, :edit]) (the objects cannot be derived from their IDs only but are needed for the path).
This only happens when using mocked objects with RSpec 3 and Rails 4.2.1. Any help would be greatly appreciated since this makes a lot of tests fail right now.
Rspec 3 extracted mocks support into the rspec-activemodel-mocks gem, so you might need to add rspec-activemodel-mocks to your Gemfile in order for the route helpers to behave as expected in your specs.
I have a web page (https://) in to this page whenever I'm trying to click on any link it is giving me weird error. This is giving me error when I'm using firefox browser to automate.
If I use chrome it is clicking on any link without giving any error.
HTML is like this:
<li id="tab2" class=""><a role="button" aria-pressed="false" id="tab2link" onfocus="onFocusLink("tab2link")" onblur="onBlurLink("tab2link")" href="/workplace/myportal/!ut/p/c5/04_SB8K8xLLM9MSSzPy8xBz9CP0os3hLAyAwNTAwsvAKMjbw9HQJdXYLCTU2CDYAykeaxRvgAI4GIN1OIGYASHeYM1C3ob-_ZaCfr4GBvxFENx55_HaHg1xrFu_nbxTqZuJpaGhh5mpoYGTmYeLkE-Zp4O5iDJHH4zo_j_zcVP2C3NAIgywTRQDl3__u/?uri=nm:oid:6_B0000P002GVC30IMJ4J6J400U3" style="outline: none; ">MyLink</a></li>
The error I'm getting is as follows :
Selenium::WebDriver::Error::UnknownError: l is undefined
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:9497:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10131:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10136:in `unknown'
from [remote server] file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/webdrive r-profile20120921-5620-dorvjl/extensions/fxdriver#googlecode.com/components/comm and_processor.js:10074:in `unknown'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/response.rb:52:in `assert_ok'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/response.rb:15:in `initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:59:in `new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:59:in `create_response'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/default.rb:65:in `request'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/http/common.rb:40:in `call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:598:in `raw_execute'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:576:in `execute'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/remote/bridge.rb:358:in `clickElement'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.25.0/lib/s elenium/webdriver/common/element.rb:54:in `click'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir-webdriver/elements/element.rb:108:in `click'
from (irb):6
from C:/Ruby192/bin/irb:12:in `<main>'irb(main):007:0>
Can anyone help me out for this as this is completely out of my mind.
Watir code I'm using is a simple link clicking code by its text
browser.link(:text, "MyLink").click
Also if I pass any argument in click method like :shift or :control, it is working, it is clicking on the link but not without arguments, It is happening in firefox using watir-webdriver
Since your html shows an anchor element try this instead (I've had similar issues and do this to get around):
browser.a(:text, 'MyLink').click
Using Capybara with Rails 3, Rspec and Cucumber,
When I use the select statement, such as
select("Unspecified", :from=> 'record_family_')
I get an error, wrong number of arguments (2 for 3). Likewise, if I omit the second argument, I get wrong number of arguments (1 for 3). This happens whether I'm using RSpec or Cucumber. If I switch to Webrat, everything works.
Details: Rails 3.0.4, rspec-core 2.5.1, rspec-rails 2.5.0, capybara 0.1.4.2, rack 1.2.1
The first few lines of the stack trace (with the path simplified) are:
wrong number of arguments (1 for 3) (ArgumentError)
actionpack-3.0.5/lib/action_view/helpers/form_options_helper.rb:131:in `select'
capybara-0.4.1.2/lib/capybara/dsl.rb:104:in `select'
step_definitions/sim_db_steps.rb:412:in `block in <top (required)>'
cucumber-0.10.0/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
cucumber-0.10.0/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
cucumber-0.10.0/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
cucumber-0.10.0/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
cucumber-0.10.0/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
Any ideas?
Thanks to Jonas Niklas for pointing out the problem, a name space issue. I had indirectly included ActionView::Helpers::FormOptionsHelper into the test cases so that the ActionView select was conflicting with the Capybara one.
I had a name space issue also with select (it was using kernel instead of page.select). I ended up having to change this:
RSpec.configure do |config|
config.include Capybara::DSL
config.include ActionView::Helpers::FormOptionsHelper
end
To this:
RSpec.configure do |config|
config.include ActionView::Helpers::FormOptionsHelper
config.include Capybara::DSL
end
Just the ordering of the includes fixed it.