jekyll plugin not working, can't find plugin - ruby

I'm new to ruby ,when i want to use github build a blog,and i added a plugin
slashdotdash/jekyll-lunr-js-search for full text search, I put jekyll-lunr-js-search.rb
under ./_plugins,then I added gems:[jekyll-lunr-js-search] to my _config.yml, after this I can't build site, got this error:
ray#ubuntu:/var/www/ss$ jekyll build -t
Configuration file: /var/www/ss/_config.yml
/home/ray/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:
in require': cannot load such file -- jekyll-lunr-js-search.rb (LoadError) from /home/ray/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require'
from /home/ray/.rvm/gems/ruby-2.0.0-p247/gems/jekyll-1.3.0/lib/jekyll/site.rb:81:in block in setup'
Please help!!!

fixed..I should not add this gems:[jekyll-lunr-js-search] to_config.yml...

Related

Calabash Error - superclass mismatch for class AuthenticationPage

I am new to Ruby/Calabash and managed to set a dedicated calabash automation framework for ios with a page object model pattern and its running successfully.
I want to extend the same framework for android too. I created a dedicated folder for ios and android inside features folder and thought of having their respective page objects inside those folder.
But when I ran calabash-android, calabash finds a similar page class exists in ios folder and started throwing the error message. I want to follow same naming convention for ios and android pages without having this name-clash. Is it possible?
superclass mismatch for class AuthenticationPage (TypeError)
/Users/MACUSER/Documents/Automation/features/ios/pages/authentication_page. rb:5:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_language.rb:95:in `load'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_language.rb:95:in `load_code_file'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:82:in `each'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:184:in `load_step_definitions'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:42:in `run!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/cli/main.rb:47:in `execute!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/bin/cucumber:13:in `<top (required)>'
/usr/bin/cucumber:23:in `load'
/usr/bin/cucumber:23:in `<main>'
Based on your description of the issue, it is not clear what the problem is.
I think it would help if you added more details about your folder structures and files.
But as you have not mentioned profiles as all I am suspecting that you are not using an .yml file.
When you execute your tests you should define what profile you are running and have one for iOS and one for Android. For each profile you will define what folders to include.
Like this
android: PLATFORM=android RESET_BETWEEN_SCENARIOS=1 -r features/support -r features/android/support -r features/android/helpers -r features/step_definitions -r features/android/pages/
And then when you execute the tests you define for what profile
calabash-android run path_to.apk -p android features/login.feature
If you have not already you should look at either Xamarin cross-platform tutorial or on the Github page for same
had similar problem, solved by adding exclude option "--exclude ios" to android profile in config/cucumber.yml file (and "--exclude android" for ios respectively)
---
android: PLATFORM=android --exclude ios -r features/support -r features/android -r features/step_definitions -r features/android/pages
ios: PLATFORM=ios APP_BUNDLE_PATH=path_to_your.app --exclude android -r features/support -r features/ios/support -r features/ios/helpers -r features/step_definitions -r features/ios/pages
seems to be cucumber bug, because according to cucumber docs -r switch should prevent loading all files except those specified explicitly
-r, --require LIBRARY|DIR Require files before executing the features. If this
option is not specified, all *.rb files that are
siblings or below the features will be loaded auto-
matically. Automatic loading is disabled when this
option is specified, and all loading becomes explicit.
Files under directories named "support" are always
loaded first.
...
-e, --exclude PATTERN Don't run feature files or require ruby files matching PATTERN
Xamarin is saying you should give the profile and the config in the command --profile ios --config=config/cucumber.yml. See this:
test-cloud submit prebuilt/Moda-cal.ipa 93dbwrmwrb0d65099640f23 --devices 99dwdhw846 --series "ip7" --locale "en_US" --app-name "Moda" --user gunesmes#gmail.com --profile ios --config=config/cucumber.yml
test-cloud submit prebuilt/Moda.apk 93dbwrmwrb06sfu440f23 --devices 9933nb846 --series "nex" --locale "en_US" --app-name "Moda" --user gunesmes#gmail.com --profile android --config=config/cucumber.yml

How to deploy "quickstart-jekyll-zurb" to heroku

I've cloned this repo:
https://github.com/lvillani/quickstart-jekyll-zurb
I got it working locally no problem.
I added a Procfile with the following:
web: bundle exec jekyll serve -P $PORT
Heroku accepts the bundle no problem.
But the server crashes when trying to load a page.
The first problem I had was that it was trying to render a misformated vendor page.
I fixed that by adding this to _config.yml:
exclude:
- "vendor/bundle/ruby
But now my app.scss file can't #import "foundation/settings";.
Here is the relevant portion of the Heroku logs.
"2014-10-16T19:56:05.366451+00:00 app[web.1]: Generating...
2014-10-16T19:56:05.361060+00:00 app[web.1]: Configuration file: /app/_config.yml
2014-10-16T19:56:06.277480+00:00 app[web.1]: Conversion error: There was an error converting 'asset/app.scss'.
2014-10-16T19:56:06.277526+00:00 app[web.1]: jekyll 2.1.1 | Error: File to import not found or unreadable: foundation/settings.
2014-10-16T19:56:06.277529+00:00 app[web.1]: Load path: /app/_vendor/foundation/scss
Everything works fine locally, so I assume this is a Heroku configuration issue but I don't know enough about Heroku to begin to know where to look.
thanks!
Maybe you forgot to run a make setup.
Note that your jekyll is 2.1.1 and current version is 2.4.

Heroku load error on require?

My Ruby application runs fine on my nitrous.io box, but when I push it to Heroku and it attempts to run a scheduled process, the logs show this error:
2013-12-23T22:37:11.902160+00:00 heroku[scheduler.4283]: State changed from starting to up
2013-12-23T22:37:12.178751+00:00 app[scheduler.4283]: from /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require'
2013-12-23T22:37:12.178751+00:00 app[scheduler.4283]: from /app/bin/rbtc:3:in `<main>'
2013-12-23T22:37:12.178751+00:00 app[scheduler.4283]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:53:in `require': cannot load such file -- rbtc_arbitrage (LoadError)
2013-12-23T22:37:13.432972+00:00 heroku[scheduler.4283]: Process exited with status 1
2013-12-23T22:37:13.461438+00:00 heroku[scheduler.4283]: State changed from up to complete
This is the code in /app/bin/rbtc:3
#!/usr/bin/env ruby
require 'rbtc_arbitrage'
RbtcArbitrage::CLI.start ARGV
File structure link
I tried changing this to require_relative as in a answer to someone else on Stack Overflow to no avail.
I'm kinda at a loss here. Any help is appreciated!
Please, make sure that this file exists: lib/rbtc_arbitrage.rb which loads other files in your repo like this (syntax is valid if you are using bundler):
require 'rbtc_arbitrage/version'
require 'rbtc_arbitrage/file1'
# .. and so on
Now, adding this file should work alone, but if this does not work, try adding your lib directory to the LOAD PATH in your bin/rbtc file before any require statments, like this:
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
This explicitly tells ruby to add the lib directory to the load path, and should solve your problem.

Checking if proxy is working in Ruby

I'm new to Ruby and trying to find a way to check if a proxy is working. I've tried using the 'net/ping' library but I am just getting some errors while requiring it(in Interactive Ruby the script works even though there are the errors, it just closes itself when I run the script normally though)
I'm trying to find a solution to make it either ignore the error, fix the error or find another way to check if the proxy works.
Thanks for help.
This is the error message I get when I try to require the 'net/ping'
proxy.rb(main):005:0> require 'net/ping'
LoadError: no such file to load -- windows/console
from C:/Ruby191/lib/ruby/gems/1.9.1/gems/net-ping-1.5.2/lib/net/ping/ext
ernal.rb:12:in require'
from C:/Ruby191/lib/ruby/gems/1.9.1/gems/net-ping-1.5.2/lib/net/ping/ext
ernal.rb:12:in'
from C:/Ruby191/lib/ruby/gems/1.9.1/gems/net-ping-1.5.2/lib/net/ping.rb:
10:in require'
from C:/Ruby191/lib/ruby/gems/1.9.1/gems/net-ping-1.5.2/lib/net/ping.rb:
10:in'
from C:\Users\X\Desktop\proxy.rb:5:in require'
from C:\Users\X\Desktop\proxy.rb:5
from C:/Ruby191/bin/irb:12:in'
In my opinion the only way to check if a proxy is working is to connect through it and make a request.

Metric Fu: RCov fails to load spec_helper

I am trying to run metric_fu on a Rails 3 application. All is good, with the exception of rcov. I have RSpec configured and my tests follow the spec/**/*.rb format and run fine in RSpec. Trying to check coverage with rcov, however, I get the following errors:
** Running the specs/tests in the [test] environment
No file to analyze was found. All the files loaded by rcov matched one of the
following expressions, and were thus ignored:
[/\A\/Users\/Eric\/\.rvm\/rubies\/ruby\-1\.8\.7\-p299\/lib/,
/\btc_[^.]*.rb/,
/_test\.rb\z/,
/\btest\//,
/\bvendor\//,
/\A\/Users\/Eric\/\.rvm\/gems\/ruby\-1\.8\.7\-p299#-backend\/gems\/rcov\-0\.9\.8\/lib\/rcov\/formatters\/base_formatter\.rb\z/,
/\bvendor\//,
/\bconfig\//,
/\benvironment\//,
/\/gems\//,
/\/Library\//,
/\/usr\//,
/spec/]
You can solve this by doing one or more of the following:
* rename the files not to be ignored so they don't match the above regexps
* use --include-file to give a list of patterns for files not to be ignored
* use --exclude-only to give the new list of regexps to match against
* structure your code as follows:
test/test_*.rb for the test cases
lib/**/*.rb for the target source code whose coverage you want
making sure that the test/test_*.rb files are loading from lib/, e.g. by
using the -Ilib command-line argument, adding
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
to test/test_*.rb, or running rcov via a Rakefile (read the RDoc
documentation or README.rake in the source distribution).
/Users/Eric/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec_helper (LoadError)
from /Users/Eric/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/models/account_spec.rb:1
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299#backend/gems/rcov-0.9.8/bin/rcov:511:in `load'
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299#backend/gems/rcov-0.9.8/bin/rcov:511
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299#backend/bin/rcov:19:in `load'
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299#backend/bin/rcov:19
When I run rcov directly, it appears that part of the issue is rcov not correctly loading the spec_helper in my specs, which is required as "require 'spec_helper'".
Any help on how to resolve this? Thanks.
Adding "-Ispec" to the Metric-Fu configuration fixes this.

Resources