I am getting this when I run a barebones rubocop.
gem list | egrep 'rubocop|cookstyle'
cookstyle (7.10.0)
rubocop (1.12.1, 1.12.0)
rubocop-ast (1.4.1)
rubocop-performance (1.10.2)
The error follows upon running rubocop with no parameters:
Unable to activate cookstyle-7.10.0, because rubocop-1.12.1 conflicts with rubocop (= 1.12.0)
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:2298:in `raise_if_conflicts'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems/specification.rb:1415:in `activate'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems.rb:224:in `rescue in try_activate'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems.rb:217:in `try_activate'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:123:in `rescue in require'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:34:in `require'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader_resolver.rb:17:in `block (2 levels) in resolve_requires'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader_resolver.rb:13:in `each'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader_resolver.rb:13:in `block in resolve_requires'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader_resolver.rb:12:in `tap'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader_resolver.rb:12:in `resolve_requires'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader.rb:45:in `load_file'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_loader.rb:106:in `configuration_from_file'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_store.rb:69:in `for_dir'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/config_store.rb:48:in `for_pwd'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/cli.rb:128:in `apply_default_formatter'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/lib/rubocop/cli.rb:40:in `run'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/exe/rubocop:13:in `block in <top (required)>'
/Users/stuartcracraft/.rvm/rubies/ruby-2.5.9/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/gems/rubocop-1.12.1/exe/rubocop:12:in `<top (required)>'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/bin/rubocop:23:in `load'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/bin/rubocop:23:in `<main>'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/bin/ruby_executable_hooks:22:in `eval'
/Users/stuartcracraft/.rvm/gems/ruby-2.5.9/bin/ruby_executable_hooks:22:in `<main>'
I tried removing either rubocop version but got the same error.
I am trying to find a way to lint chef ruby code, hence the above attempt.
If anyone sees anything in the above errors or has another linter with a smoother
install, please let me know.
Thanks.
Stuart
Version conflicts are typically resolved with bundler. Try bundle exec rubocop.
Related
I am trying to run msfdb but I can't seem to do so because I get a LoadError and 2 ThreadErrors. Here is the full stack:
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- net/smtp (LoadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
from /usr/share/metasploit-framework/lib/rex/proto/sms/model.rb:29:in `<top (required)>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:27:in `require'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `const_get'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:95:in `cget'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:237:in `block (2 levels) in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:26:in `block in ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `each_child'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader/helpers.rb:18:in `ls'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:232:in `block in eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `synchronize'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:217:in `eager_load'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.5.4/lib/zeitwerk/loader.rb:317:in `eager_load_all'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application/finisher.rb:133:in `block in <module:Finisher>'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `instance_exec'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:32:in `run'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:61:in `block in run_initializers'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `call'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
from /home/johnmap007/.rvm/rubies/ruby-3.1.0/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/initializable.rb:60:in `run_initializers'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/application.rb:391:in `initialize!'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `public_send'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/railties-6.1.5/lib/rails/railtie.rb:207:in `method_missing'
from /usr/share/metasploit-framework/config/environment.rb:4:in `<top (required)>'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `require'
from /usr/share/metasploit-framework/lib/msfenv.rb:17:in `<top (required)>'
from /usr/bin/msfconsole:18:in `require'
from /usr/bin/msfconsole:18:in `<main>'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fc80 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
/usr/bin/msfconsole: warning: Exception in finalizer #<Proc:0x00007f4a9fb4fde8 /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:85>
/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `new': can't alloc thread (ThreadError)
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:471:in `create_with_logging_context'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:436:in `new'
from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/concurrent-ruby-1.0.5/lib/concurrent/atomic/ruby_thread_local_var.rb:86:in `block in threadlocal_finalizer'
Side Note: From what I understand, the 2 ThreadErrors that were thrown were because I have insufficient memory? I have 16GB total though, that should be enough.
Before this, I was unable to install certain dependencies because of some weird reason but I installed Oracle Instant Client, which allowed me to install ruby-oci8, which then let me continue with the rest of the dependency installation. I reran bundle install for that and that fixed most of it (I had to manually install certain gems with gem install <gem> but reran bundle install to make sure I had everything at the end). Now I'm getting these weird LoadErrors and ThreadErrors. One thing to note is that I'm executing msfdb run and msfconsole as root (It's necessary for msfdb run because it won't let me run it as a normal user), but when I run msfconsole as a normal user, metasploit loads as expected without any errors. Can someone please help me fix this?
Starting with Ruby 3.1, net-smtp is a bundled gem.
Probably, you just need to add
gem 'net-smtp'
to your Gemfile.
Here is the what my terminal is showing me..
user#Users-MacBook-Pro palindrome_app % bundle exec rake test
/Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mustermann-1.1.1/lib/mustermann.rb:73:in `new': Hash can't be coerced into Mustermann::Pattern (TypeError)
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mustermann-1.1.1/lib/mustermann.rb:70:in `block in new'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mustermann-1.1.1/lib/mustermann.rb:70:in `map'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/mustermann-1.1.1/lib/mustermann.rb:70:in `new'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1641:in `compile'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1629:in `compile!'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1271:in `error'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1839:in `<class:Base>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:894:in `<module:Sinatra>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:22:in `<top (required)>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/main.rb:1:in `require'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/main.rb:1:in `<top (required)>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra.rb:1:in `require'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra.rb:1:in `<top (required)>'
from /Users/user/Desktop/repos/palindrome_app/app.rb:1:in `require'
from /Users/user/Desktop/repos/palindrome_app/app.rb:1:in `<top (required)>'
from /Users/user/Desktop/repos/palindrome_app/test/test_helper.rb:3:in `require_relative'
from /Users/user/Desktop/repos/palindrome_app/test/test_helper.rb:3:in `<top (required)>'
from /Users/user/Desktop/repos/palindrome_app/test/site_pages_test.rb:1:in `require_relative'
from /Users/user/Desktop/repos/palindrome_app/test/site_pages_test.rb:1:in `<top (required)>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_test_loader.rb:17:in `require'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_test_loader.rb:17:in `block in <main>'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_test_loader.rb:5:in `select'
from /Users/user/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/rake-13.0.3/lib/rake/rake_test_loader.rb:5:in `<main>'
rake aborted!
Command failed with status (1)
/Users/user/.rbenv/versions/3.0.0/bin/bundle:23:in `load'
/Users/user/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'
Tasks: TOP => test
(See full trace by running task with --trace)
tl;dr: Upgrade sinatra to version 2.1.0. (Or, downgrade ruby to v2.7.)
You are running old gem versions (in particular, sinatra v2.0.3), with the latest version of ruby (v3.0.0). You may run into various compatibility problems by doing that, because you could be missing crucial ruby 3.0 compatibility updates from those libraries.
There are various mentions of ruby 2.7+ keyword deprecation fixes in the sinatra changelog.
Specifically, this error:
gems/3.0.0/gems/sinatra-2.0.3/lib/sinatra/base.rb:1629:in `compile!'
Was fixed by this change in this PR, which shipped as part of sinatra v2.0.8. Also, additional fixes were added as part of the v2.1.0 release.
I'm updating a Rails 3.2 app to Ruby 2.2.2. I've pulled the Rails version up to 3.2.22, which is necessary for Ruby 2.2.2. That went relatively well but prompted a Cucumber update, from 1.2.1 to 1.3.20. (I don't recall the details, because that was several failed efforts ago, but I think my features were passing but then exiting false before I did this.)
Now Cucumber features run fine (albeit with a ton of unrelated Ruby 2.2.2 warnings), but rspec does not. Specifically, when I run rake spec I get this error:
/path/to/gems/cucumber-1.3.20/lib/cucumber/rb_support/rb_dsl.rb:15:in `build_rb_world_factory': undefined method `build_rb_world_factory' for nil:NilClass (NoMethodError)
The stack trace leads through Capybara (2.4.4, pinned for other reasons), ActiveSupport, and Bundler back up to rspec-core.
All my searches trying to find similar issues just lead to the code, because it seems like the only place this method name exists is in code.
Why am I getting this error from Capybara/Cucumber when running rspec? How can I fix it?
ETA: Stack trace, with paths condensed a bit:
/path/to/gems/cucumber-1.3.20/lib/cucumber/rb_support/rb_dsl.rb:15:in `build_rb_world_factory': undefined method `build_rb_world_factory' for nil:NilClass (NoMethodError)
from /path/to/gems/cucumber-1.3.20/lib/cucumber/rb_support/rb_dsl.rb:50:in `World'
from /path/to/gems/capybara-2.4.4/lib/capybara/cucumber.rb:4:in `<top (required)>'
from /path/to/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'
from /path/to/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'
from /path/to/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'
from /path/to/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'
from /path/to/gems/capybara-screenshot-0.2.2/lib/capybara-screenshot.rb:96:in `<top (required)>'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
from /path/to/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
from /path/to/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
from /path/to/app/config/application.rb:13:in `<top (required)>'
from /path/to/app/config/environment.rb:2:in `require'
from /path/to/app/config/environment.rb:2:in `<top (required)>'
from /path/to/app/spec/spec_helper.rb:10:in `require'
from /path/to/app/spec/spec_helper.rb:10:in `<top (required)>'
from /path/to/app/spec/controllers/academic_years_controller_spec.rb:1:in `require'
from /path/to/app/spec/controllers/academic_years_controller_spec.rb:1:in `<top (required)>'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
from /path/to/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
from /path/to/gems/rspec-core-3.2.3/exe/rspec:4:in `<main>'
/path/to/ruby/ruby-2.2.2/bin/ruby -I/path/to/gems/rspec-core-3.2.3/lib:/path/to/gems/rspec-support-3.2.2/lib /path/to/gems/rspec-core-3.2.3/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
My hunch is that there's a configuration file which needs to be rebuilt somewhere.
From your stacktrace - the capybara-screenshot gem is requiring capybara/cucumber even though you're running specs which aren't using cucumber. This means World is called from capybara/cucumber against a non-initialized cucumber, and gives the error. The version of capybara-screenshot you're using is really old, and the code that required capybara/cucumber has since been removed so you should probably update the version of capybara-screenshot you're using, and add
require 'capybara/cucumber'
require 'capybara-screenshot/cucumber'
to your env.rb or other cucumber support file
This question and answer might be simple however I thought it would be worth sharing.
I cloned the github repository https://github.com/mikel/mail.git and browsing the specs.
I just thought of running the specs inside the application so ran the command "rspec".
Error description
athi#localhost mail (master) $ rspec
Running Specs under Ruby Version 2.1.5
/Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2104:in `raise_if_conflicts': Unable to activate rspec-3.3.0, because rspec-core-3.4.0 conflicts with rspec-core (~> 3.3.0) (Gem::ConflictError)
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1282:in `activate'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:198:in `rescue in try_activate'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems.rb:195:in `try_activate'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /Users/athi/Documents/apps/github/mail/spec/spec_helper.rb:18:in `<top (required)>'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/athi/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/athi/Documents/apps/github/mail/spec/mail/attachments_list_spec.rb:2:in `<top (required)>'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1361:in `load'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1359:in `each'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:102:in `setup'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:88:in `run'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:73:in `run'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/lib/rspec/core/runner.rb:41:in `invoke'
from /Users/athi/.rvm/gems/ruby-2.1.5/gems/rspec-core-3.4.0/exe/rspec:4:in `<top (required)>'
from /Users/athi/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `load'
from /Users/athi/.rvm/gems/ruby-2.1.5/bin/rspec:23:in `<main>'
from /Users/athi/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
from /Users/athi/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
After a little search I found that the "bundle" is not initialised for this repository and the Gemfile.lock is missing.
So I just ran
bundle install
and it worked.
It installed the necessary gems and then I was able to run the specs properly.
So I'm totally a Rails newbie. And this might be more of a linux question... Since the issue seems to revolve around libicu-devel and the charlock_holmes gem.
I've been following these too guides primarily (along with Google searches of course). I've got Rails 4 on Ruby 2 from RVM. And it's a RHEL5 install at Rackspace (dedicated).
https://github.com/gitlabhq/gitlabhq/blob/5-4-stable/doc/install/installation.md
http://blog.lsong.org/2013/07/install-gitlab-on-centos-6/
After having a few issues along the way I thought I was making progress until I got to grabbing packages from yum and the fact that there doesn't seem to be a package of libicu past 3.6 anywhere. I compiled that from source and everything seemed to install OK. The charlock_holmes gem was added.
But then after adding the DB stuff for GitLab I went to initialize things and can't go any further and now I have no idea what to do. I've found references to other errors at this point but they're usually from the DB not being setup properly so they're not helpful.
Anyone with more Rails experience than me know what I can do next?
rvmsudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
rake aborted!
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so: undefined symbol: _ZN7icu_4_28ByteSink15GetAppendBufferEiiPciPi - /home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes.rb:1:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/gitlab-grit-2.5.1/lib/grit.rb:79:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/gitlab_git-1.3.0/lib/gitlab_git.rb:4:in `<top (required)>'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/jharvey/.rvm/gems/ruby-2.0.0-p247#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/git/gitlab/config/application.rb:9:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
(See full trace by running task with --trace)
Let me know if I need to add more information. I tried adding the --trace flag and got the same output. I'm guessing on the libicu/charlock_holmes being the problem since it's the first message after rake aborted!.
My company won't spring for anything like Github enterprise and I was hoping to build a subdomain with some tools to share code with our numerous divisions. At the rate I'm going I might as well write a new app from scratch. Thanks in advance!
Update: Ran :check with --trace and noticed while most of it was the same, there were a few extra lines at the end.
Update 2: Tried the two suggestions. Switched to 1.9.3 and ran the bundle config command (no output). Ran trace again, and here's the result.
rvmsudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production --trace
rake aborted!
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so: undefined symbol: _ZN7icu_4_28ByteSink15GetAppendBufferEiiPciPi - /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes/charlock_holmes.so
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support /dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.9.4/lib/charlock_holmes.rb:1:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab-grit-2.5.1/lib/grit.rb:79:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/gitlab_git-1.3.0/lib/gitlab_git.rb:4:in `<top (required)>'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/jharvey/.rvm/gems/ruby-1.9.3-p448#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/git/gitlab/config/application.rb:9:in `<top (required)>'
/home/git/gitlab/Rakefile:5:in `require'
/home/git/gitlab/Rakefile:5:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/rake:23:in `load'
/home/git/gitlab/vendor/bundle/ruby/1.9.1/bin/rake:23:in `<main>'
Update 3: Making progress. I seem to have successfully got everything installed after messing around with redis for a bit. I can check the "env:info" successfully. However now I try and get gitlab online using init.d and it's not working. =/ There was no init script after install so I grabbed one from gitlabhq per this post, GitLab installation on linux (using 5-4 like my install). That script results in:
/etc/init.d/gitlab start
bash: bundle: command not found`
We'll see if I can sort that out. I welcome any help.
Update 4: Sorted that out. RVM couldn't be seen by the git user. Haven't tested every aspect of the system but I now have GitLab running on a git subdomain. Don't have a specific answer to the original question. But I seem to have gotten to the end of the journey. crosses fingers
For me, this was an LDD issue. On my system, headers for libicui18n were installed, while both libicui18n.so.36 and libicui18n.so.42 were installed.
Validate this with
ldd vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-{YOUR VERSION HERE}/charlock_holmes/charlock_holmes.so
Look for the line
libicui18n.so.## => ...
If ## is 36, then bundler's linking against the wrong version (it should be 42). Bundler seemed to be disregarding the --with-icu-dir flag. Not sure why.
My fix was to use gem to compile charlock_holmes
gem install charlock_holmes -v '0.6.9.4' -- --with-icu-dir=[...]
where [...] was the path to the lib directory in which icu 42 was installed. Then I just copied the generated binary (charlock_holmes.so) over the one produced by bundler.