The Rails project I'm working on includes the gem 'therubyracer' on its Gemfile. When I do
bundle install I get the following error:
...
Using launchy 2.4.2
Using less 2.4.0
Using less-rails 2.4.2
Bundler::GemspecError: Could not read gem at /Users/Swanros/.rvm/gems/ruby-2.0.0-p353#c-bullz/cache/libv8-3.16.14.3-x86_64-darwin-12.gem. It may be corrupted.
An error occurred while installing libv8 (3.16.14.3), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
When I do gem install libv8 -v '3.16.14.3 it succeeds, and I cant finish bundling my project.
I've already uninstalled libv8, reinstalled it again, as well as therubyracer, and I still can't manage to get this to work.
Any ideas?
This solved my problem:
rm -rf /Users/Swanros/.rvm/gems/ruby-2.0.0-p353#c-bullz/cache/
:D
I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks.
Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me.
assuming you use rbenv:
rbenv install 1.8.7-p375
rbenv rehash
rbenv global 1.8.7-p375
bundle install
Related
I've just removed rbenv as i wanted to install a newer Ruby version (2.6) than the ones available for rbenv, then installed Ruby 2.6, that went fine, now while trying to reinstall all the gems for my app I ran into the following problem:
$ bundle install
Installing signet 0.14.0
Gem::InstallError: signet requires Ruby version >= 2.4.0.
An error occurred while installing signet (0.14.0), and Bundler cannot continue.
Make sure that `gem install signet -v '0.14.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
google_drive was resolved to 2.1.12, which depends on
google-api-client was resolved to 0.21.2, which depends on
googleauth was resolved to 0.6.7, which depends on
signet
But ruby has clearly been upgraded:
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux-gnu]
and if I try to install signet manually it works fine:
gem install signet -v '0.14.0' --source 'https://rubygems.org/'
Successfully installed signet-0.14.0
Parsing documentation for signet-0.14.0
Done installing documentation for signet after 0 seconds
1 gem installed
But then if i run bundle install again I still get the same problem. I've also tried bundle install --path vendor/cache and bundle install --system to no avail.
Note that the gems seem to install in the right place:
gem which signet
/var/lib/gems/2.6.0/gems/signet-0.14.0/lib/signet.rb
if I compare it to another one installed by bundler:
gem which multi_json
/var/lib/gems/2.6.0/gems/multi_json-1.14.1/lib/multi_json.rb
This is on Ubuntu 16.04.4 LTS and bundler 1.16.3
How do I fix this?
So I've finally figured it out, installing a newer version of bundler (but < 2.0 as Rails 4.2 requires it) did the trick, although i also had to uninstall the ruby 2.2-dev package and install the 2.6-dev package to be able to compile native gems like nokogiri, then running the whole thing specifying the bundler version.
For those interested, these were the commands:
apt-get remove ruby-dev
apt install ruby2.6-dev
gem install bundler -v 1.17.3
bundle _1.17.3_ install
I am trying to run "bundle update", but I keep getting the error message:
An error occurred while installing rack (2.0.1), and Bundler cannot continue.
Make sure that `gem install rack -v '2.0.1'` succeeds before bundling.
Then I install rack 2.0.1:
sudo gem install rack -v 2.0.1
Successfully installed rack-2.0.1
Parsing documentation for rack-2.0.1
Done installing documentation for rack after 2 seconds
1 gem installed
Then I even ran "rbenv rehash", and I run "bundle update" again and the same error message shows up. How do I get Bundler to recognize the new gem?
Make sure you have the "bundler" installed from the ruby version installed by rbenv first. Then, check the ruby version in that directory. It should be the one that you installed from rbenv or rvm. After these, if you are installing something just don't use sudo before bundle. Because bundle is from the rbenv ruby version. If the rbenv rehash doesn't work, just restart the bash and check.
If the without sudo thing needs permission, you are most likely using the bundler that was installed by your system ruby as sudo gem install bundler.
Try reinstalling bundler without a sudo like gem install bundler and retry.
Even if that doesn't work, remove the Gemfile.lock in your directory. Remove any version of rack mentioned in your Gemfile if any. Just have the gem name like gem 'rack' and try bundle install again. The gem that you could install with sudo was stored for the system ruby, not the one you have installed through rbenv.
When you ran sudo install, your gem most probably got installed under a different directory. When using Rbenv or VRM, you shouldn't use sudo.
First of all you could try uninstalling the gem from your system gems and doing it again without sudo.
Going into extremes you could completely reinstall your rbenv with gems (and while at it switch to RVM, personally I think its easier to manage). After that try to bundle install everything again without sudo and it should work.
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling.
My s/w version are:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x64-mingw32]
Rails -v 4.2.5
windows 10
gem -v 2.4.5.1
Bundler 1.5.0 has a bug where it doesn't recognize default gems as referenced here.
The solution was to update to bundler 1.5.1 using gem install bundler -v '= 1.5.1'
I don't know much about Windows but you could try to install this GMP package. As suggested on the json Github issues page, people on linux should install the package below:
sudo apt-get install libgmp3-dev
And what it seems is that package for Windows has a similar dll which could resolve your problem.
There are known issues with the gem json 1.8.3 and ruby 2.2.3 listed in thoses issues #259 and #229
I upgraded ruby to 1.9.3, and now I can't get my server to start. When I run bundle install, it says
An error occurred while installing libv8 (3.11.8.17), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.11.8.17'` succeeds before bundling.
When I try to install that gem, it says
ERROR: Error installing libv8:
ERROR: Failed to build gem native extension.
/Users/Erica/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
I'm an HTML/CSS coder, not really a Ruby developer, so any thoughts are really appreciated.
I resolved this issue by using the following command:
gem install libv8 -v 3.11.8.17 -- --with-system-v8
It works with RVM on Mavericks.
https://stackoverflow.com/a/19667419/763744
Try reinstalling v8 in homebrew:
gem uninstall libv8
brew install v8
gem install libv8
Do:
gem install rmagick -v '2.13.2'
gem install libv8 -v 3.11.8.17 -- --with-system-v8
I encountered this problem a few times already, first thing I'd try is to (re)install command line tools. Normally should work.
Another attempt that succeeded once was uninstalling libv8, and then installing it again. It takes ages...
This simple solution worked for me:
$ gem uninstall libv8 # select "All Versions" if prompted
$ gem install libv8
I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks.
Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me.
libv8 (3.16.14.3-x86_64-darwin-13) and the therubyracer (0.12.0) gems installed without problem.
assuming you use rbenv:
rbenv versions
system
* 1.8.7-p354
2.0.0-rc2
rbenv uninstall 1.8.7-p354
rbenv install 1.8.7-p375
rbenv versions
system
* 1.8.7-p375
2.0.0-rc2
bundle install
I'm having issues with the libv8 gem with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]. gem install libv8 works fine and I have
gem 'therubyracer'
in my Gemfile and this has a dependency on libv8 which is installed when I do a bundle install:
$ bundle exec gem list
*** LOCAL GEMS ***
actionmailer (3.1.3)
actionpack (3.1.3)
...
libv8 (3.3.10.4 x86_64-darwin-10)
...
but when I run:
$ rails s
Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.
it can't find libv8 - is this is a 32/64 bit issue? If so, how do I solve it?
I suspect this was because I had a 32/64 bit mismatch.
I solved this with the following:
$ irb
ruby-1.9.3-p0 :001 > `gem list`.each_line {|line| `sudo env ARCHFLAGS="-arch x86_64" gem install #{line.split.first}`
I had a similar problem deploying from an x86 dev box to an x86_64 server (using capistrano)
When I did the deployment, I got the same 'Could not find libv8-3.3.10.4 in any of the sources' message. This is because running 'bundle pack' on an x86 machine only copies the x86 gem into the /vendor/cache directory!
I fixed this by explicitly adding the linux x86_64 gem file to the /vendor/cache directory, so that it would agree with the deployment server architecture. Deployment ran fine after that.
Another solution is to use nodejs instead of therubyracer. You install it on the server using apt-get/yum, so there's no need for your Gemfile to include execjs or therubyracer.
You can actually install that version on Mavericks:
gem install libv8 -v 3.11.8.17 -- --with-system-v8
You can provide whatever libv8 gem version you want to install ..
After this you might facing issue with installing therubyracer then
Update Version of Gemfile to point to the last version like so:
gem "therubyracer", "~> 0.10.2"
and I was able to successfully install the gem.
If you want to manually install the gem, you can use:
gem install therubyracer --version "~> 0.10.2"
Have you tried bundle exec rails s? It's possible that there's a conflict between the gems you have installed on your system and the gems that are required for your project to run.
I resolved this issue by installing nodejs (latest version). What it does is that it installs the libv8 -dev library along with it. Thus rather than installing the gem what you require is the native library.
You can install it directly or install nodejs as well in your system and the above error should be resolved.