I tried install the sqlite3 gem via the following command line:
gem install sqlite3
but I keep getting the following error:
ERROR: Error installing sqlite3:
invalid gem: package is corrupt, exception while verifying: undefined method `path2class' for #<Psych::ClassLoader:0x00000101269b78> (NoMethodError) in /Users/Peter/.rvm/gems/ruby-2.0.0-p353/cache/sqlite3-1.3.8.gem
I've tried the previous versions but all of the them give the same error. Removing the cache doesn't solve it either.
Any help is appreciated.
PS: I'm running this under OSX Mavericks.
Delete the gem at /Users/Peter/.rvm/gems/ruby-2.0.0-p353/cache/sqlite3-1.3.8.gem. RubyGems didn't download it properly (and improperly didn't reset the download). Try installing it again, it should work now.
Asking just in case but, do you have SQLite3 installed? The gem needs it to work. You can get it from http://www.sqlite.org/ (According to rubygems). You also need SQLite 3.6.16 or newer for the latest version of the gem to work.
Related
I've been fighting this issue for months now. I can't successfully install node on my Mac M1. I recently bumped into this detailed guide that fortunately is made exactly for my machine, which apparently has something that prevents the correct installation of node: https://gist.github.com/LeZuse/bf838718ff2689c5fc035c5a6825a11c
I tried following the guide, but when I get to point 2 and I insert the command 'nvm install lts/fermium' I get 'zsh: command not found: nvm'.
I also tried entering the command 'arch -x86_64 nvm install lts/fermium' but also in that case I get 'arch: Can't find nvm in PATH'.
What can I do differently?
I'm using PyInstaller to compile a program and keep coming across the error "No module named 'charset_normalizer.md__mypyc.'" The Charset-Normalizer package is installed.
As a test, I tried re-compiling a program that I had previously created in early September without issue, but now receive the same error. I thought that maybe there is an issue with the versions of either PyInstaller or Charset-Normalizer so I've experimented with different versions, but cannot get it to work.
You are probably missing the "chardet" library
I installed it and it worked.
pip install chardet
I had the EXACT problem. Scripts that I was able to make into executables using Pyinstaller before I could no longer do so again. In my script I used the pdfplumber package, which when you install it also installs other packages like pillow, wand, charset-normalizer, etc.
Since the error was regarding charset-normalizer for me as well, I tried different versions of it. For me it was version 2.1.0 that made the executable work again. Install it with the "pip install charset-normalizer==2.1.0" command: https://pypi.org/project/charset-normalizer/2.1.0/.
If it does not work, go to "Release history" on that link and try another version. Try to remember when was the last time you created a working executable and get the version you think will work for you.
This worked for me:
I just added
from charset_normalizer import md__mypyc
to the top of my python script.
https://stackoverflow.com/a/58449206/20576777
If you don't have the charset-normalizer library installed, then you should install it using the following command:
pip install charset-normalizer
I got it to work by installing older versions of PyInstaller and Charest-Normalizer. Anytime this messages pops-up, consider installing an older version of the package.
Pyinstaller may sometimes miss your dependency. In such a case run pyinstaller with the --collect-all option.
In this case --collect-all charset_normalizer should force pyinstaller to include the dependency.
I'm trying to install RSRuby on Ubuntu 10.04. I barely even know what error messages to report as the relevant ones; I've just been googling around for several hours and none of the commands I try solve the problem.
Here are a few sample error messages:
$ sudo gem install rsruby -- --with-R-dir=/usr/lib/R
Building native extensions. This could take a while...
ERROR: Error installing rsruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-R-dir=/usr/lib/R
checking for main() in -lR... yes
checking for R.h... no
ERROR: Cannot find the R header, aborting.
Gem files will remain installed in /var/lib/gems/1.8/gems/rsruby-0.5.1.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ext/gem_make.out
or doing it with apt-get:
$ sudo gem install rsruby --include-dependencies -- --with-R-dir=/usr/lib/R/lib64/R --with-R-lib=/usr/lib/R/lib64/R/bin --with-R-include=/usr/lib/R/lib64/R/include
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
ERROR: Error installing rsruby:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb --with-R-dir=/usr/lib/R/lib64/R --with-R-lib=/usr/lib/R/lib64/R/bin --with-R-include=/usr/lib/R/lib64/R/include
checking for main() in -lR... no
ERROR: Cannot find the R library, aborting.
Gem files will remain installed in /var/lib/gems/1.8/gems/rsruby-0.5.1.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ext/gem_make.out
I also got the latest RSRuby from GitHub and following the instructions from its 2006 PDF manual:
$ ruby setup.rb config -- --with-R-dir=/usr/lib/R
---> lib
---> lib/rsruby
<--- lib/rsruby
<--- lib
---> ext
/usr/bin/ruby1.8 /home/mars/R/rsruby/ext/extconf.rb --with-R-dir=/usr/lib/R
checking for main() in -lR... yes
checking for R.h... no
ERROR: Cannot find the R header, aborting.
*** /home/mars/R/rsruby/ext/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=/home/mars/R/rsruby/ext
--curdir
--ruby=/usr/bin/ruby1.8
--with-R-dir
--with-R-include
--without-R-include=${R-dir}/include
--with-R-lib
--without-R-lib=${R-dir}/lib
--with-Rlib
--without-Rlib
setup.rb:655:in `command': system("/usr/bin/ruby1.8" "/home/mars/R/rsruby/ext/extconf.rb" "--with-R-dir=/usr/lib/R") failed (RuntimeError)
from setup.rb:660:in `ruby'
from setup.rb:1238:in `extconf'
from setup.rb:1230:in `config_dir_ext'
from setup.rb:1532:in `__send__'
from setup.rb:1532:in `traverse'
from setup.rb:1549:in `dive_into'
from setup.rb:1530:in `traverse'
from setup.rb:1524:in `exec_task_traverse'
from setup.rb:1519:in `each'
from setup.rb:1519:in `exec_task_traverse'
from setup.rb:1223:in `exec_config'
from setup.rb:991:in `exec_config'
from setup.rb:826:in `__send__'
from setup.rb:826:in `invoke'
from setup.rb:773:in `invoke'
from setup.rb:1578
and in irb:
irb(main):002:0> require 'RSRuby'
LoadError: no such file to load -- RSRuby
from (irb):2:in `require'
from (irb):2
from :0
irb(main):003:0> rsruby
NameError: undefined local variable or method `rsruby' for main:Object
from (irb):3
from :0
Sometimes I'm seemingly able to get something that looks like it works, but still can't load rsruby from the irb command line.
$ sudo gem install rsruby --include-dependencies -- --with-R-dir=/usr/lib/R --with-R-lib=/usr/lib/R --with-R-include=/usr/share/R/include/
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
Successfully installed rsruby-0.5.1.1
1 gem installed
Installing ri documentation for rsruby-0.5.1.1...
Installing RDoc documentation for rsruby-0.5.1.1...
then
$ irb
irb(main):001:0> require 'rsruby'
LoadError: no such file to load -- rsruby
from (irb):1:in `require'
from (irb):1
from :0
Ruby is version 1.8.7, I did sudo apt-get install ruby1.8-dev today but I'm not sure if that left things worse, better, or unchanged. Or if this would be easier in ruby1.9.
R is working.
I don't read Japanese but this worked for me on Ubuntu 10.10, ruby 1.9: http://d.hatena.ne.jp/cuspos/20090520/1242825057
# gem install rsruby-0.5.1.1.gem -- --with-R-dir=/usr/lib/R --with-R-include=/usr/share/R/include
Building native extensions. This could take a while...
Successfully installed rsruby-0.5.1.1
1 gem installed
# export R_HOME=/usr/lib/R
# irb
irb(main):001:0> require 'rsruby'
=> true
irb(main):002:0>
You might want to check to see if your PATH variables or dynamic links are set up so that Ruby and friends are "looking" in the right place. Ruby appears to expect RSruby to be in /var/lib/gems/1.8/gems/rsruby-0.5.1.1/ or perhaps /usr/lib/ruby/1.8/rubygems/ or perhaps /var/lib/gems/1.8/gems/rsruby-0.5.1.1/lib/, .... while your configure report says it was installed in /usr/bin/ruby1.8 /home/chris/R/. I don't have a ton of Linux experience, but what I do have tells me that each distro is different with respect to where it expects to find installed executables.
Your attempts with apt-get and gem install suggest that the installer cannot find the R header files. I would start by fixing this problem, not try other ways of installing RSruby. The next question is why it cannot find the R headers, there are two options:
The headers are installed, but they cannot be found. Use locate R.h to find where the R header file is located, and make sure this is in your $PATH.
The headers are not installed (which I suspect is the case). Often installing header files requires a development package to be installed. Try and see if there is an R-dev package or something named similarly which would contain, among others, the R header file. Installing this R-dev can be done using apt-get. The standard version of R in ubuntu 10.04 is not really up-to-date I think. CRAN has ubuntu repositories, where the dev package is called r-base-dev. Adding this repo to your sources.list gets you the latest version of R from CRAN through apt-get.
You have successfully installed rsruby, as shown by the output from your 5th example:
Successfully installed rsruby-0.5.1.1
1 gem installed
The library did not load in irb because using Ruby 1.8.7, you need to "require rubygems" first. Try this in irb:
require 'rubygems'
require 'rsruby'
I am trying to install Firewatir on my PC (its OS is Windows). I have installed the jssh and test it. It is properly installed.
After that, I tried to install the firewatir gem. So I ran this command:
gem install firewatir
Then, I got this error:
ERROR: While executing gem ... (RunTimeError)
Error installing firewatir:
firewatir requires commonwatir = 1.6.5
Does that mean I have to install commonwatir first? When I tried to install commonwatir, I got similar error. But this time, the commonwatir required user-choices. And now, it becomes a long dependence chain of installation.
Watir installation page says all you need to do is
gem install watir
Firewatir is part of Watir.
After Installing Rails 3, I get the following error regarding Sqlite3 when I try to do a migrate:
dlsym(0x1037e5f10,
Init_sqlite3_native): symbol not found
- /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.bundle
I am using Snow Leopard, if that makes a difference.
I faced the same issue. The problem is that your sqlite-ruby interface is not installed properly in your snow leopard. To install that , use the following :-
sudo gem install sqlite3-ruby
But before installing that check if a proper gcc is installed in your Mac.Use the below lines to check that :-
ok First of all check if the follwoing is installed:-
$gcc -v
If not then you have to install Mac developers xcode package in your snow leopard first.
You can download using a free registration from this site:- http://developer.apple.com/devcenter/mac
For more reference take a look into my post : How to install ruby interface for sqlite3 in Mac snow leopard?
If you face the problem the problem even after trying these please let me know the error your facing. Because I faced all the error before making my snow leopard work ;). So I 'm familiar to most of the errors and blunders we usually make ;) !!
Hmm, looks like maybe something isn't compiled correctly. Maybe a gem was compiled on an older system or pre-upgrading to snow leopard? It may be that the sqlite binary is 64 bit but the native ruby extension isn't.
I'd try this:
Install RVM (Or create a new gemset if you're already using it.)
Using a fresh rvm gemset, re-install rails 3
Do bundle install to get all your gems loaded
If the problem goes away then it's likely that your libraries aren't all compiled the same way. This can happen when upgrading to snow leopard from a previous version of Mac OS X. The upgrade would have updated the sqlite binary but not any gems you had compiled yourself, like the sqlite bindings for ruby.
I'm not sure how it's done with Snow Leopard but you need to install The sqlite dev package, libsqlite3-dev
Then install the gem, sqlite3-ruby
Just got to the GEMFILE inside you project and comment out the gems that you do not require.