I'm getting this error when I try to bundle install
Bundler::GemspecError: Could not read gem at /home/theareba/.rvm/gems/ruby-2.0.0-p353/cache/nokogiri-1.6.1.gem. It may be corrupted.
An error occurred while installing nokogiri (1.6.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.6.1'` succeeds before bundling.
I've tried removing nokogiri in the cache and bundle installing again in vain.
Here's my gemfile
source 'https://rubygems.org'
gem 'rails', '4.0.0'
ruby "2.0.0"
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-1-stable'
gem 'spree', github: 'spree/spree', branch: '2-1-stable'
gem 'bootstrap-sass', '2.3.2.0'
gem 'sass-rails'
gem 'uglifier'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder'
group :development, :test do
gem 'turn', :require => false
gem 'sqlite3'
gem 'taps', :require => false
gem 'rspec-rails'
end
group :production do
gem 'pg', '0.15.1'
gem 'rails_12factor'
end
UPDATE
Error that occurs when I run gem install nokogiri -v '1.6.0'
Fetching: mini_portile-0.5.2.gem (100%)
Fetching: nokogiri-1.6.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/nokogiri-1.6.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.6.0/ext/nokogiri/gem_make.out
Note: I've installed both libxslt1-dev and libxml2-dev that are requirements in nokogiri installation.
I've also tried gem install nokogiri -v '1.6.1' but it still fails. I've installed nokogiri -v 1.5.0 in another app so I tried it in this app and got the error that spree requires nokogiri version 1.6.0 or greater. I'm I missing something?
So here's what solved my problem. I created a new gemset i.e
rvm gemset create nokogiri
rvm use ruby-2.0.0-p353#nokogiri
Note: I'm using rvm and ruby 2.0.0. Then I made sure I've got necessary lib installed by running
sudo apt-get install libxml2-dev libxslt-dev
The libraries happened to be already installed. Then I installed nokogiri
gem install nokogiri -v '1.6.1'
It installed successfully. And finally ran bundle install to get all my gems. Hope this helps anyone having the same issue.
Check the RVM gemset. I fixed it by restoring the gemset. If you try upgrading to 4.0.2? I used Nokogiri 1.6.1 with Ruby 2.0.0 and Rails 4.0.2
try this
sudo apt-get install ruby-dev
sudo apt-get install libxml2 libxml2-dev libxslt1-dev
and reinstall nokogiri
sudo gem install nokogiri
Related
I want to integrate twitter-boostrap in my Ruby on Rails project.
For that i have written- gem "therubyracer" gem "less-rails" gem "twitter-bootstrap-rails" on my gemfile. And then bundle install in rails command prompt.
After installing less-rails. This error is comming
Gem::Installer::ExtensionBuildError: ERROR:
Failed to build gem native extension`
c:/row/Ruby200/bin/ruby.exe extconf.rb`
creating Makefile
The system cannot find the path specified.
The system cannot find the path specified.`
c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/builder.rb:58:
in `setup_python!': libv8 requires python 2 to be installed in order to build, b
ut it is currently not available (RuntimeError)
from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/builder.rb:42:in `block in build_libv8!'
from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/builder.rb:40:in `chdir'
from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/builder.rb:40:in `build_libv8!'
from c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:24:in `install!'
from extconf.rb:7:in `<main>'
Gem files will remain installed in c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8 -3.16.14.3 for inspection.
Results logged to c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/libv8-3.16.14.3/ext/libv8/gem_make.out
An error occurred while installing libv8 (3.16.14.3), and Bundler cannotcontinue.
Make sure that `gem install libv8 -v '3.16.14.3'` succeeds before bundling.
Help. thanks
Remove
group :assets do
end
But keep gems mentioned inside this group, then do bundle install.
gem 'therubyracer', :platforms => :ruby
gem 'less-rails'
gem 'devise'
I'm trying to install Jruby on ROR for my application. Used commands from its documentation https://devcenter.heroku.com/articles/moving-an-existing-rails-app-to-run-on-jruby . While bundle installation got the following errors
Your Ruby engine is ruby, but your Gemfile specified jruby
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
Furthermore certain gems are not installed successfully, shows error like
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.
Not able to find the issue. Would somebody help with this ?
Gemfile :
ruby '1.9.3', :engine => 'jruby', :engine_version => '1.7.9'
gem "rake"
gem "rails", "3.2.16"
gem 'foreigner'
gem 'activerecord-jdbcpostgresql-adapter'
gem 'jruby'
gem 'airbrake'
gem "spreadsheet", "~> 0.9.0"
gem 'paperclip'
gem 'aws'
gem 'aws-sdk'
gem 'aws-s3', :require => nil
gem 'authlogic'
gem 'execjs'
gem 'mail', :require => nil
gem 'fastercsv', :require => nil
gem "rspec-rails"
gem 'rubyzip', :require => nil
gem 'test-unit'
gem 'typhoeus'
gem 'thin'
gem 'therubyracer'
gem 'useragent'
gem 'will_paginate'
gem 'therubyracer'
gem 'libv8', '3.16.14.3'
You can't use 'therubyracer' and 'libv8' gems with JRuby.
Short answer:
Use 'therubyrhino' gem instead (https://github.com/cowboyd/therubyrhino)
Explanation:
There are some gems that can't be used under JRuby, because they are using native (C) extensions - here is a list: https://github.com/jruby/jruby/wiki/C-Extension-Alternatives
Make sure to install all below libraries, before installing Ruby/RVM.
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev
Before JRuby installation.
sudo apt-get install ruby-dev
sudo apt-get install build-essential g++
rvm install jruby
Don't specify Jruby version, default you will get latest version.
I'm trying to use capistrano to deploy, and it fails because of a rubyracer gem issue.
I tried adding the following variants to gemfile and then deploying to a production server on ubuntu and nothing works:
1)
gem 'libv8', '3.11.8.3'
3)
gem 'therubyracer'
gem 'libv8', '3.3.10.4'
4)
gem 'libv8', '~> 3.11.8.3'
It all gives the same error:
An error occured while installing therubyracer (0.11.0), and Bundler cannot continue.
Make sure that gem install therubyracer -v '0.11.0' succeeds before bundling.
So I try this instead:
group :production do
gem 'therubyracer', '0.10.2', :platforms => :ruby
end
But that causes this error:
Bundler could not find compatible versions for gem "libv8":
In Gemfile:
therubyracer (= 0.10.2) ruby depends on
libv8 (~> 3.3.10) ruby
libv8 (3.11.8.3)
It seems I currently have two version of lib8 on server:
libv8 (3.11.8.4, 3.3.10.4 x86_64-linux)
Any ideas?
After hours of trying solutions from stackoverflow, I got an easy fix from this site with just 2 commands, the author mentioned that
When installing therubyracer gem you may run into this problem on a
fresh machine install.
http://usefulprogrammingshit.drmcnasty.com/?p=12
sudo apt-get install g++
sudo apt-get install build-essential
I know nothing of ruby so you would need to research more about this solution, but after all, "therubyracer 0.12.2" is installed on ubuntu 14.04. I hope it could help.
Just uninstall both libv8 from your machine
Terminal
gem uninstall libv8
In terminal, You will be prompt to select which version do you want to uninstall like this:
libv8 3.3.10.4 x86_64-linux
libv8 3.11.8.4 x86_64-linux
All
Select 3 and hit enter(return key). It will uninstall your both libv8 versions installed in your machine.
Now, in your Gemfile just include therubyracer without libv8 and bundle install
gem 'therubyracer'
bundle install
It will work
At the command line of the production server do
gem install therubyracer
try node.js as your runtime javascript environment, but not libv8.
if you insist on libv8, don't specify the version. it seems that there's conflicts on the versions. e.g. in your Gemfile:
gem 'therubyracer'
gem 'libv8'
When I do a
bundle install --path vendor/bundle
on my app, I get the following error.
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 1.0.18) java
Current Bundler version:
bundler (1.1.5)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
My gem list shows that I have the mentioned gem
*** LOCAL GEMS ***
bundler (1.1.5, 1.0.22, 1.0.18)
My gem file looks like this
gem "rake", "0.9.2"
gem "activerecord-jdbc-adapter", "1.2.0"
gem "activerecord-jdbcmysql-adapter", "1.2.0"
gem "acts_as_tree", "0.1.1"
gem "bundler", "1.0.18", :require => "bundler"
gem "database_cleaner", "0.6.7"
gem "jdbc-mysql", "5.1.13"
gem "jruby-jars", "1.6.2"
gem "jruby-rack", "1.1.3"
gem "jruby-openssl", "0.7.4"
gem "net-scp", "1.0.4"
gem "net-ssh", "2.2.1"
gem 'uuidtools', "2.1.1"
gem 'nokogiri', "1.5.0"
How do I fix this? I use jruby-1.6.3 and rails 3.0.10.
Have you tried to
- either remove bundler from the gemfile
- set it to the bundler version to use to bundle it
- or vice versa: use the bundler version to bundle that you require in the gem file
but as Anthony said, do you have a reason for including it in the Gemfile ?
I'm trying to open by my rails console in my newsly created app, but I can't connect to a database. It looks like there might be a problem with sqlite3-1.3.3 vs 1.3.4
$ rails c
/Library/Ruby/Gems/1.8/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `establish_connection': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (can't activate sqlite3 (~> 1.3.4, runtime), already activated sqlite3-1.3.3. Make sure all dependencies are added to Gemfile.) (RuntimeError)
Install
$sudo gem install
ERROR: could not find gem activerecord-sqlite3-adapter locally or in a repository
What gems I have installed
$gem list
*** LOCAL GEMS ***
...
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3, 1.3.2, 1.2.5)
I'm using rails 3.1.1
EDIT:
Here is my gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Running bundle install produces this
$sudo bundle install
using rake (0.9.2.2)
...
Using sqlite3 (1.3.3)
Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.
$ bundle show sqlite3
/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3
You're using Rails 3.1, which uses bundler to manage gems.
Add gem 'sqlite3' to your Gemfile
run bundle form the command line
This will install the gems your app needs. You should then be able to launch the console.
I've seen similar situations in the past because of missing/bad shared libraries. Gems install ruby code, native bindings to libraries, but they do not install the external libraries themselves.
The dependency for sqlite on Ubuntu, for example, is libsqlite3-dev.
$ sudo apt-get install libsqlite3-dev
For OSX:
Install sqlite3 on mac osx?