How to resolve gem dependencies when installing rbenv? - ruby-on-rails

Recently I have installed rbenv and specified ruby to 2.3.1 and rails to 5.1.1 but I couldn't run my projects because I got:
Ignoring json-2.1.0 because its extensions are not built. Try: gem pristine json --version 2.1.0
Ignoring nokogiri-1.8.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.8.1
Ignoring unf_ext-0.0.7.4 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.4
Ignoring yajl-ruby-1.3.1 because its extensions are not built. Try: gem pristine yajl-ruby --version 1.3.1
/var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find unf_ext-0.0.7.4 in any of the sources (Bundler::GemNotFound)
from /var/lib/gems/2.3.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
...
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<main>'
I ran:
bundle install
Installation passed successfully, but... Now I get:
/home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:6:in `require': incompatible library version - /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi_c.so (LoadError)
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:6:in `rescue in <top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/ffi-1.9.18/lib/ffi.rb:3:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify/native.rb:1:in `require'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify/native.rb:1:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify.rb:1:in `require'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/rb-inotify-0.9.8/lib/rb-inotify.rb:1:in `<top (required)>'
from /home/alex/pnv/vendor/bundle/ruby/2.3.0/gems/listen-3.0.8/lib
...
from /home/alex/.rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:59:in `require'
from -e:1:in `<main>'
And I have no idea how to resolve this. Any help is appreciated!
UPDATE 1:
Finally, I've found source of the evil bug - nevertheless, I specify Rails 5.1.1, when I run rails new app_name, it installs 5.1.6! And seems like it uses 5.1.6 gem dependencies... Still don't know how to resolve instead of upgrading to >= 5.1.6

Add the following line to your Gemfile.
gem 'rails', '5.1.1'
Run bundle install

Related

Could not railties in mac os

I had recently followed multiple blogs to completely wipe out rvm, rails and then reinstalled ruby 2.3.0 and rails 5. Made and app using it no issues. But the moment I opened a new terminal window in my machine it was not recognising rails at all as if it was only installed in that particular terminal.
So I just completed my work in that single terminal. Now when I restarted my laptop, I am unable to run the same app. I do not wish to reinstall everything again as I am sure this is a small configuration problem. Why is this happening?
The error message that I am getting now:
/Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'railties' (>= 0.a) among 30 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/sahil/.rvm/gems/ruby-2.3.1:/Users/sahil/.rvm/gems/ruby-2.3.1#global', execute `gem env` for more information
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /Users/sahil/.rbenv/versions/2.3.1/bin/rails:22:in `<main>'
I have already seen other similar questions where they ask to reinstall everything again which I do not want to do as it worked after installing but did not work on system restart.
Now I did gem install rails in one terminal and the app is working again, but if I try to open a new terminal and give the same command rails s, it gives me this error,
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
Ignoring nokogiri-1.6.8 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.8
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
/Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/io-console-0.4.6/lib/io/console.bundle (fatal)
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/user_interaction.rb:9:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/config_file.rb:8:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:4:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/shared_helpers.rb:6:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/sahil/.rvm/gems/ruby-2.3.1#global/gems/bundler-1.12.5/lib/bundler/setup.rb:2:in `<top (required)>'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /Users/sahil/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Users/sahil/Documents/work/Development/todoApp/config/boot.rb:3:in `<top (required)>'
from bin/rails:3:in `require_relative'
from bin/rails:3:in `<main>'
You mentioned that you reinstalled ruby 2.3.0 and Rails 5. However it seems rbenv is trying to load your project with ruby 2.3.1.
You should switch to ruby 2.3.0. I guess you should be able to do: rbenv local 2.3.0.
To avoid this from happening again though, you should add a .ruby-version dotfile to your project root and in the file only add 2.3.0.
Hope that works

Ruby on rails bundle install - json error

I have a lot of difficulties to run Ruby on Rails. Maybe you can tell me where I'm wrong ?
I'm on Linux Mint 17.2, with LAMP local server.
To install Ruby :
$ sudo apt-get install ruby
$ ruby -v
ruby 1.9.3p484
$
I didn't have to install gem, it works as shown here :
$ gem help commands
GEM commands are:
build Build a gem from a gemspec
cert Manage RubyGems certificates and signing settings
(...)
update Update the named gems (or all installed gems) in the local
repository
which Find the location of a library file you can require
For help on a particular command, use 'gem help COMMAND'.
Commands may be abbreviated, so long as they are unambiguous.
e.g. 'gem i rake' is short for 'gem install rake'.
Then I installed rails, I dont remember which of those two ways :
$ sudo gem install rails
or
$ sudo apt-get install ruby-railties-4.0
I dont find how to uninstall, so I can't test other ways to install.
Then, I made an application :
$ rails new (path)/second_app
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
(...)
create vendor/assets/javascripts
create vendor/assets/javascripts/.keep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.keep
run bundle install
/usr/lib/ruby/1.9.1/rubygems.rb:308:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:268:in `bundle_command'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/generators/app_base.rb:277:in `run_bundle'
from (eval):1:in `run_bundle'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /var/lib/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/commands/application.rb:43:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/lib/rails/cli.rb:15:in `<top (required)>'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /var/lib/gems/1.9.1/gems/railties-4.0.2/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
It looks like it was a problem running bundle install. According to tutorials, I run the command
$ bundle install
And I got
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.4.2)
Using i18n (0.7.0)
Using minitest (4.7.5)
…
Using jbuilder (1.5.3)
Using jquery-rails (3.1.3)
Installing json (1.8.3)
Gem::Installer::ExtensionBuildError: 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:1:in `<main>'
Gem files will remain installed in /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3 for inspection.
Results logged to /home/alejandro/.bundler/tmp/9377/gems/json-1.8.3/ext/json/ext/generator/gem_make.out
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.
I tryed to install json in several ways :
$ sudo gem install json -v '1.8.3'
$ sudo apt-get install json -v '1.8.3'
$ sudo gem install json
But it don't work. I tryed to to run de server :
$ rails server
Could not find gem 'rails (= 4.0.2) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
I have tryed to install rvm and rbenv, but nothing works in the way tutorials says it should. My feeling is that I missed something in the begynning, but I dont know what.
Could you please help me ?
Thanks
Alex
You need to update gem lock and all dependency
For that please execute below command,
gem update --system
Now You can install json gem using ,
gem install json
Try above command and let me know if you still face same thing. Above things works fine for me:D

Ruby on Rails - Lynda - Generating a Controller and View, Error on 'Rails Generate' Command

I'm new to Ruby on Rails and was following Lynda's Ruby on Rails essential training guide videos.
In the getting started set of videos, we are shown how the 'rails generator' command works. I have followed all the steps, but every time I type in '$ rails generate' I get the following error:
Warning: You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all` for better startup performance.
/Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/commands.rb:33:in `<module:Spring>'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/commands.rb:4:in `<top (required)>'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:77:in `preload'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:140:in `serve'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /Library/Ruby/Gems/2.0.0/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/waleedrahamtullah/.rbenv/versions/2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
How do you suppose I get around this?
The answer is in the Error:
You're using Rubygems 2.0.14 with Spring. Upgrade to at least Rubygems 2.1.0 and run `gem pristine --all`
Update with this:
gem install rubygems-update
Then run:
gem pristine --all
All should be well.
When I update
gem install rubygems-update
and then
gem pristine --all
it didn't work for me.
But answer from How to upgrade rubygems helped to fix issue, but after that for some reason I had to install rails again and install all gems.
Install rubygems-update
gem install rubygems-update
update_rubygems
gem update --system
run this commands as root or use sudo.
I am using ruby with rbenv so I could run those as normal user.
However, generating new rails site
rails new blog
Shows warning about old rubygems.
Warning: You're using Rubygems 2.0.14 with Spring.
Hmm. Checking the environment:
gem env
shows
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.14
which is no good. As suggested on the internets I run:
gem install rubygems-update
gem pristine --all
update_rubygems
I am not sure if gem pristine --all was needed, but it can't harm anything. Checking the update status now
gem env
shows
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.6
which is good. Calling
rails new blog
and everything went ok. No warning at all.

rails cannot load such file -- mysql2/mysql2 (LoadError)

I am newbie to ruby on rails i could not find the solution for this error:
rails s
/usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `require': cannot load such file -- mysql2/mysql2 (LoadError)
from /usr/local/share/gems/gems/mysql2-0.3.13/lib/mysql2.rb:8:in `<top (required)>'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /usr/local/share/gems/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/Harish/Documents/simple_cms/config/application.rb:7:in `<top (required)>'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /usr/local/share/gems/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
gem uninstall mysql2
gem install mysql2 --platform=ruby
delete the mysql2 gem directory in your rails specific bundle directory and copy paste this newly install mysql2 gem
For Rails 3.2.17 and Ruby 1.9.3-p448 and mysql2 0.3.11, running bundle update mysql2 updated to 0.3.15 and got rid of the error for me.
Ya, It's happening with new version(0.3.13) of mysql2 gem with rails 4.0.0. Deleting the bundle folder under vendor directory, and rerunning bundle install, update fixed this issue for me
cd {Your_RailsApp_Root}/vendor/
rm -rf bundle/
cd {Your_RailsApp_Root}
bundle install
bundle update
Do you have the mysql2 gem installed? Check that your gemfile has gem "mysql2" and then run bundle install from the root of your rails app. Also, ensure that you mysql downloaded in your development environment.
just downgrade the mysql2 version. In my case, I used '0.2.6' version and it worked for me.
gem 'mysql2', '0.2.6'
with ruby version 2.0.0 and gem version 1.8.25
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
from
https://gorails.com/setup/osx/10.14-mojave
I battled this for a day when running into it while trying to run bundle exec rake db:migrate after successfully bundle installing my project gems.
For me, mysql2 was trying to load a configuration file that didn't exist. I had already brew installed mysql on my system, and what mysql2 was looking for existed already in the mysql installation. I ran
gem install mysql2 -v 0.5.3 -- --with-mysql-config=/usr/local/Cellar/mysql#5.6/5.6.42/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
to point mysql2 to the correct configuration.
NOTE the version you have of mysql may be different and the version of the gem you want may also be different.
ALSO NOTE: the gem install path may be different than your bundle install path. You can also the gem to your bundle directory with
gem install --install-dir /path/to/bundle/directory
OR you can set gem options with your bundle build configuration:
bundle config --local build.mysql2 --with-mysql-config="/usr/local/Cellar/mysql#5.6/5.6.42/bin/mysql_config" --with-ldflags=-"L/usr/local/opt/openssl/lib" --with-cppflags=-"I/usr/local/opt/openssl/include"
Apple silicon M1:
gem install mysql2 -v '0.5' -- --with-opt-dir=$(brew --prefix openssl)
It work for me.
gem uninstall mysql2
sudo gem install mysql2
bundle
this solved my error:
[root#localhost cms]# su Harish
[Harish#localhost cms]$ bundle install
[Harish#localhost cms]$ rails s

Error : 'incompatible library version' sqlite3-1.3.11 in rails

I working on Ubuntu system(16.04).
My problem is whenever i setup any rails project and try to run rails s then i got 'incompatible library version' error for sqlite3 something like below.
/home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:6:in `require': incompatible library version - /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.so (LoadError)
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:2:in `<top (required)>'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `block (2 levels) in require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `block in require'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `each'
from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `require'
from /usr/lib/ruby/vendor_ruby/bundler.rb:99:in `require'
from /home/jiggs/sites/albumriverfinal/config/application.rb:7:in `<top (required)>'
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /home/jiggs/.rvm/gems/ruby-2.3.1#albumriver/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Rails version : 4.0.0
ruby version i tried with rails 4.0.0 :
ruby-2.0.0-p247 [ x86_64 ]
ruby-2.2.5 [ x86_64 ]
ruby-2.3.0 [ x86_64 ]
ruby-2.3.0-preview1 [ x86_64 ]
ruby-2.3.1 [ x86_64 ]
I trying to uninstall sqlite3 using gem uninstall sqlite3 and trying to run bundle install but got this error :
An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
Then i run gem install sqlite3 -v '1.3.11' and run rails server and got same error again incompatible library version.
Output of sqlite3 gem install :
gem install sqlite3 -v '1.3.11'
Fetching: sqlite3-1.3.11.gem (100%)
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.11
Parsing documentation for sqlite3-1.3.11
Installing ri documentation for sqlite3-1.3.11
Done installing documentation for sqlite3 after 1 seconds
1 gem installed
The SQLite library is likely to be corrupted. Try reinstalling the gem by running the following from a command pronpt:
gem uninstall sqlite3
Then run:
bundle install
I've rolled back ruby version to 2.3.0 and all worked .It seems to be an issue
#Jiggs: The same issue I got when my system updated to 16.04. After that all previous applications were difficult to configure as throwing so many dependency errors, in which your error was one of them.
After lots of finding only conclusion I got the problem is on RVM,
If you are using RVM then please install Rails 5.0 in yous default gemset
rvm gemset use default
gem install rails -v=5.0
After installing rails 5 all the compatible dependencies get installed.
Now move to your any project CREATE New GEMSET (please don't use previous).
rvm gemset create my_new_gemset
rvm gemset use my_new_gemset
Finally do bundle install
In my case after doing this resolved all the errors as you mentioned.
I know it is bit strange that installing Rails-5 in default gemset and using new gemset resolved this issue. But somehow it works.
Hope this will help you.
For me going back to ruby 2.2.5p319 helped. I just realize the version of the Ruby that comes with Rails has to match to the one installed even though the RubyInstaller release gets ahead.
I came here looking for answer, didn't help me, but I found a solution here, (it appears to be an issue with 1.3.11, downgrade to 1.3.10 did the trick)

Resources