Working in Rubymine form windows using wsl and running everything with wsl terminal Im getting the following error from rubocop all the time:
Error:/home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize': Could not find ffi-1.15.1 in any of the sources (Bundler::GemNotFound)
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:85:in `map!'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:170:in `specs'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:237:in `specs_for'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/definition.rb:226:in `requested_specs'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:108:in `block in definition_method'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:20:in `setup'
from /home/dor/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/bundler.rb:107:in `setup'
from /home/dor/ ...
this is quite annoying.
also bundle keeps asking to bundle install together with this error which I ran and did not help
For whatever command you are running, make sure that you're using bundle exec, for example:
$ bundle exec rubocop
Next, you can try the following:
Install ffi manually to see if your Gem path is set up correctly: gem install ffi
Re-install bundler: gem uninstall bundler && gem install bundler
Remove the Gemfile.lock file (make a backup) and re-run bundle install.
Run bundle update or bundle update ffi
Try bundle --full-index (ref)
I see that you're not using JRuby, but I've also had problems where I had to use bundler (with an R) instead of bundle for JRuby, so you could try that.
For WSL specifically, I also found other people having this issue with Jekyll and WSL. The solution was to fix the GEM path. Follow the instructions here.
If still none of this helps you, please describe how you're installing Ruby on WSL and what command you are using that produces this error.
Related
I am trying to run a Ruby app I downloaded from Github in Virtual Studio Code. I'm pretty clueless but I followed the documentation and got as far this error when I try to run the rails dev server:
/Library/Ruby/Site/2.6.0/rubygems.rb:265:in find_spec_for_exe': can't find gem ruby-debug-ide (>= 0.a) with executable rdebug-ide (Gem::GemNotFoundException) from /Library/Ruby/Site/2.6.0/rubygems.rb:284:in activate_bin_path'
from /usr/local/bin/rdebug-ide:23:in `'
Can anyone please help me understand what this means and how to solve it?
Have you added the gem to your computer?
Try running: gem install ruby-debug-ide
This would install the gem on your system and the issue should not happen anymore.
I was trying to connect rubocop to atom, but received the error:
linter-registry.js [sm]:144 [Linter] Error running RuboCop Error: /usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'rubocop' (>= 0.a) among 16 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/home/kurilovichay/.rvm/gems/ruby-2.3.1:/home/kurilovichay/.rvm/gems/ruby-2.3.1#global', execute `gem env` for more information
from /usr/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/bin/rubocop:22:in `<main>'
at parseFromStd (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:41:43)
at Object.<anonymous> (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:212:27)
at next (<anonymous>)
at step (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:11:273)
which rubocop returns:
/usr/local/bin/rubocop
can someone assist with that?
It seems that you're using rvm to manage your environment. What i did to get it to work was follow the instructions on their repo: https://github.com/AtomLinter/linter-rubocop#settings
# make sure I'm in the global gemset
$ rvm gemset use global
# install the gem
$ gem install rubocop
configure atom to use the global. Edit your atom's config file (config.cson) and add
*:
"linter-rubocop":
executablePath: "~/.rvm/gems/ruby-2.3.1#global/wrappers"
"linter-ui-default": {}
Note: make sure that the ruby version is the one you're using.
I had this same issue when working on a Rails 6 application in Ubuntu 20.04 with rbenv as my ruby version manager.
I already had rubocop installed in the project, but Atom editor was still throwing this error.
All I had to do was to install the rubocop gem to be available globally on the machine. Open a new terminal and install it using:
gem install rubocop
That's all.
I hope this helps
i got trouble, in a rails project(redmine2.3), rails version is 3.2
start the project
bundle exec thin start -p 8080 -e production -s 5 -d
error info
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
/var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `require': libruby.so.2.0: cannot open shared object file: No such file or directory - /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/rubyeventmachine.so (LoadError)
from /var/wtn/vendor/cache/ruby/2.0.0/gems/eventmachine-1.0.3/lib/eventmachine.rb:8:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/lib/thin.rb:7:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `require'
from /var/wtn/vendor/cache/ruby/2.0.0/gems/thin-1.6.2/bin/thin:5:in `<top (required)>'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `load'
from /var/wtn/vendor/cache/ruby/2.0.0/bin/thin:23:in `<main>'
the same error happens when running rails -v
rails -v
(eval):9: warning: already initialized constant Bundler::Dsl::RAILS_VERSION_IS_3
(eval):9: warning: previous definition of RAILS_VERSION_IS_3 was here
running bundle exec ..... in the project produces the same error
the problem has solved, see my comment in the third floor , there are the answer
I was encountering this error message on Windows 10 while trying to use Jekyll's LiveReload feature. The other answers here did not solve the problem completely, or risked having the issue re-occur the next time bundle install is run.
My solution (taken from this site) was to:
Run this console command
gem uninstall eventmachine
and choose to uninstall eventmachine-1.2.7-x64-mingw32 gems from your system.
Edit Gemfile inside your project directory and add this line inside:
gem 'eventmachine', '1.2.7', git: 'https://github.com/eventmachine/eventmachine.git', tag: 'v1.2.7'
Run
bundle install
Clean up your jekyll build and cache with command
bundle exec jekyll clean
You can now use the --livereload parameter without getting any issue, even if you execute bundle install in future.
If you are using windows
Go to this folder C:\Ruby24-x64\lib\ruby\gems\2.4.0\gems\eventmachine-1.2.5-x64-mingw32\lib
open this file eventmachine.rb
write this require 'em/pure_ruby' in the first line of code in the file
this will make it work with no issues.
For Ruby 2.4 & eventmachine 1.2.6 on Windows 10.
You gotta uninstall first eventmachine and then install it again with platform ruby:
gem uninstall eventmachine (select all versions if prompted)
gem install eventmachine --platform ruby
The relevant error message here is the following:
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby'
Try to reinstall the eventmachine gem:
gem uninstall eventmachine
bundle install
See Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension
and
Rails - cannot run app: Unable to load the EventMachine C extension; for more advice on how to deal with this issue.
What worked for me on Apple Silicon M1 and Rails 6.1
Full uninstall of eventmachine: gem uninstall -aIx eventmachine followed by a rm -rf vendor/cache
Add eventmachine in the project Gemfile and forcing it to be from the master branch latest like this gem 'eventmachine', :git => 'git://github.com/eventmachine/eventmachine.git', :branch => 'master'
Run bundle install
The problem has fixed.
rm vendor/cache/ -rf
bundle install
fixed the error
remove the Redundant folder in the redmine/plugins
fixed the warnings
This is record of locating and repairing process.
thx all!
gem install eventmachine --platform ruby
I am trying to install cocoapods in my mac, but I can't get it installed. It shows the following error:
$ sudo gem update --system*
Latest version currently installed.
Aborting.
$ sudo gem install cocoapods**
Successfully installed cocoapods-0.34.4
Parsing documentation for cocoapods-0.34.4
1 gem installed
$ pod setup
/Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'cocoapods' (>= 0) among 200 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/(user name)/.rvm/gems/ruby-1.9.3-p374:/Users/vamshiraghu/.rvm/gems/ruby-1.9.3-p374#global', execute `gem env` for more information
from /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:324:in `to_spec'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:58:in `gem'
from /usr/bin/pod:22:in `<main>'
So does anybody know about this error to sort it out?
I have same problem. I got different kinds of error when try different combination of install and uninstall. like
[!] The `master` repo requires CocoaPods 0.32.1 -
or
.rvm/gems/ruby-2.0.0-p598/gems/claide-0.4.0/lib/claide/command.rb:217:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
or
.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:121:in `require': cannot load such file -- colored (LoadError)
from /Users/riverhuang/.rvm/rubies/ruby-2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:121:in `require'
from /Users/riverhuang/.rvm/gems/ruby-2.1.5#global/gems/cocoapods-0.36.2/lib/cocoapods/user_interface.rb:8:in `<module:UserInterface>'
from /Users/riverhuang/.rvm/gems/ruby-2.1.5#global/gems/cocoapods-0.36.2/lib/cocoapods/user_interface.rb:7:in `<module:Pod>'
.
.
.
from /Users/riverhuang/.rvm/gems/ruby-2.1.5/bin/pod:23:in `load'
from /Users/riverhuang/.rvm/gems/ruby-2.1.5/bin/pod:23:in `<main>'
Could not find proper version of cocoapods (0.29.0) in any of the sources
Run `bundle install` to install missing gems.
After clear all gem in my computer I finally fixed it. Here is my steps to clear all gems.
gem uninstall --all
sudo gem uninstall --all
After uninstall all gems I reinstall the cocoapods.
sudo gem install cocoapods
Then restart the Terminal and run:
pod setup
I guess it has conflict in dependency gems (wrong version or not in right path). Like once I run "bundle install" it always install cocoapods 0.29.0 and all its dependency. With and without "sodu" install gems and its dependency to different places with version 0.36.2 when I did it.
Update:
the eventmachine gem is installed and in my gemfile:
eventmachine (1.0.0, 0.12.10)
Please help! Trying to create a database with the following:
Fitzs-MacBook-Pro:twilio_insanity Fitz$ rake db:create'
Returns the following error:
Unable to load the EventMachine C extension; To use the pure-ruby
reactor, require 'em/pure_ruby' rake aborted! cannot load such file --
rubyeventmachine
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/gems/eventmachine-1.0.0/lib/eventmachine.rb:8:in
'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/gems/thin-1.5.0/lib/thin.rb:7:in
'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in
block (2 levels) in require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in
each'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in
block in require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in
each'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in
require'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.3/lib/bundler.rb:128:in
require'
/Users/Fitz/Desktop/twilio_insanity/config/application.rb:7:in' /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in
require' /Users/Fitz/Desktop/twilio_insanity/Rakefile:5:in'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in
eval'
/Users/Fitz/.rvm/gems/ruby-1.9.3-p327#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in
' (See full trace by running task with --trace)
```
try to re-install the gem 'eventmachine'
$ gem uninstall eventmachine
then
$ bundle install ( in the same folder with your Gemfile)
or just
$ gem install eventmachine ( if you are not using the Gemfile)
see: https://stackoverflow.com/a/15140634/445908
Someone kind of answered in comments...see below.
Basically though I had seperate versions of Ruby, which was getting confusing because some gems were only installed on certain versions of ruby.
Fix was totally uninstalling ruby and rails, then reinstalling. Fixed it!
This helped:
This comment in another thread seems promising for your issue. Can you ensure that you have "gem eventmachine" or similar in your Gemfile, and can successfully bundle? – Scott Helm Jan 6 at 6:24
I got the same error on Windows after upgrading ruby from 1.9.3 to 2.4.
I tried every fix I found but the only thing that helped in the end was (not that obvious and therefore hard to find) to reinstall the new Ruby again with 32 bit instead of 64.
Also I installed Eventmachine with
gem install eventmachine --platform=ruby
to force native compilation, since I always get problems with msgpack, that can be solved like this (haven't tried it with the default x86-mingw32)
I am on windows 10. C:\Ruby25-x64\lib\ruby\gems>bundle install showed Could not locate Gemfile error(though, i am having bundle gem installed and present at \gems location). Following worked for me to resolve Unable to load the EventMachine C extension error:
gem uninstall eventmachine
gem install eventmachine --platform ruby
If any of this solutions don't work, try reinstalling eventmachine gem from sources using method that worked for me on OS X: https://stackoverflow.com/a/20950026/83055
Just try the following:
apt-get install libssl0.9.8
It fixed the error on Ubuntu 12.4
Make sure you bundle eventmachine in your Gemfile
gem "eventmachine"
Then bundle install. This comment seemed relevant to you.