Ruby on Rails: cannot load rack/handler/ - ruby-on-rails

I had a fully working Rails server last night. However, on accessing my computer this morning, I found it had crashed. I booted back up, then SSHed on to my remote server, and attempted to restart the server process, first querying:
rails server -h
Which resulted in:
/usr/local/lib/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem railties (>= 0.a) (Gem::GemNotFoundException)
from /usr/local/lib/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
from /usr/local/bin/rails:22:in `<main>'
I then attempted a bundle install, which threw the following error:
enter code here/usr/local/lib/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
from /usr/local/lib/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
from /usr/local/bin/bundle:22:in `<main>'
I then reinstalled Rails with rvm use ruby-2.3.1#rails5.0 --create followed by gem install rails. rails -v now reports:
Rails 5.0.1
However, when I attempt to start a server process ( rails server -p 80 - b 139.162.246.138 ) I get:
Exiting
/home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/rack-2.0.1/lib/rack/handler.rb:74:in `require': cannot load such file -- rack/handler/- (LoadError)
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/rack-2.0.1/lib/rack/handler.rb:74:in `try_require'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/rack-2.0.1/lib/rack/handler.rb:16:in `get'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/rack-2.0.1/lib/rack/server.rb:300:in `server'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/server.rb:112:in `print_boot_information'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/server.rb:73:in `start'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/peter/.rvm/gems/ruby-2.3.1#rails5.0/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have tried uninstalling and reinstalling both ruby and rails, and running a new bundle install. Not getting basically the same error:
/home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:51: warning: constant ::Fixnum is deprecated
/home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/activesupport-5.0.1/lib/active_support/xml_mini.rb:52: warning: constant ::Bignum is deprecated
Exiting
/home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/rack-2.0.1/lib/rack/handler.rb:74:in `require': cannot load such file -- rack/handler/- (LoadError)
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/rack-2.0.1/lib/rack/handler.rb:74:in `try_require'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/rack-2.0.1/lib/rack/handler.rb:16:in `get'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/rack-2.0.1/lib/rack/server.rb:300:in `server'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/server.rb:112:in `print_boot_information'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/server.rb:73:in `start'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:90:in `block in server'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `tap'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:85:in `server'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
from /home/peter/.rvm/gems/ruby-2.4.0-rc1/gems/railties-5.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have also tried completely uninstalling rails and railties with:
gem uninstall rails -v 5.0.1
gem uninstall railties -v 5.0.1
gem install rails -v 5.0.1
gen install railties -v 5.0.1
Same error.
Attempted to locate problem call with:
sudo grep -rnw './' -e "/var/lib/gems/2.3.0/"
From source directory outputs nothing to console.
Attempting to access the directory listed in the error message results in:
cd /var/lib/gems/
-bash: /home/peter/.rvm/scripts/initialize: No such file or directory
-bash: /home/peter/.rvm/scripts/hook: No such file or directory
Running sudo gem uninstall --all to remove all gems results in:
You have requested to uninstall the gem:
actioncable-5.0.1
rails-5.0.1 depends on actioncable (= 5.0.1)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] ERROR: While executing gem ... (Gem::DependencyRemovalException)
Uninstallation aborted due to dependent gem(s)
Although removing the rails-5.0.1 gem before running the command fixed this... However, after running this command which is supposed to remove all gems, rails -v now outputs:
Rails 4.2.7.1
And running gem uninstall rails-4.2.7.1 does not remove this version.
gem uninstall -v rails-4.2.7.1 results in:
ERROR: While executing gem ... (Gem::Requirement::BadRequirementError)
Illformed requirement ["rails-4.2.7.1"]
Update: finally managed to remove rails and ruby. Reinstalled them. Same problem.
Tried creating a rew rails project and the new project does exactly the same thing.

After all that work, the solution was simple. I was typing:
rails server -p 80 - b 139.162.246.138
Instead of:
rails server -p 80 -b 139.162.246.138

have you rehashed after installing gems using => rbenv ? if not check in the => gemfile to make sure you have the matching ruby versions as well as your => gemfile.lock (in the directory your working in)

The moral of this story is that if you mangle something on the command line while invoking rails server, you'll get:
bootsnap-1.3.2/lib/bootsnap/load_path_cache/
core_ext/kernel_require.rb:32:in `require': cannot
load such file -- rack/handler/--some-wrong-option (LoadError)
This is a little ambiguous. It's not that bootsnap can't load rack, it's that it can't load the rack "some wrong option" handler, because your option is wrong, probably a typo.

Related

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

Gitlab project - failed to run "rails generate"

Introduction:
I have an installation of gitlab on a local lxc container running ubuntu 13.10 - saucy.
I have installed RVM as a as a multi-user installation - in /usr/local/rvm
In order to run gitlab with RVM I have created a wrapper for the bundle command as specified here
The gitlab application is running correctly but I have a problem running rails generate function
The steps I followed :
$ sudo su git - to login as the git user
$ cd /home/git/gitlab
$ source /etc/profile/
$ rvm use gemset ruby-2.1.1#gitlab - a custom gemset I created
$ gem list - lists all the gems that appear in the Gemfile for gitlab, so I know I am on the right gemset
$ rails -v -> Rails 4.0.3
$ rails generate --help will output
/usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `require': cannot load such file -- rb-inotify (LoadError)
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `each'
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `block in require'
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `each'
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `require'
from /usr/local/rvm/gems/ruby-2.1.1#global/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'
from /home/git/gitlab/config/application.rb:6:in `<top (required)>'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:43:in `require'
from /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:43:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
What I gathered from this output is that it is in some way trying to use the ruby-2.1.1#global gemset.
If I switch to that gemset $ rvm use gemset ruby-2.1.1#global, $ gem list will output
*** LOCAL GEMS ***
bigdecimal (1.2.4)
bundler (1.5.3)
bundler-unload (1.0.2)
executable-hooks (1.3.1)
gem-wrappers (1.2.4)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
psych (2.0.3)
rake (10.1.0)
rdoc (4.1.0)
rubygems-bundler (1.4.2)
rvm (1.11.3.9)
test-unit (2.1.1.0)
And if I run bundle install or the wrapper bundle install it says that all the gems are installed.
What am I missing here?
--------------------edit------------------
found a way to make it work
I followed the trouble shooting guide and tried
RAILS_ENV=production bundle exec rails generate --help and it worked
Apparently as stated here in the last comment, rb-inotify is "marked as development dependency" therefore forcing the environment to be production, it won't try to use it
To resolve
'require': cannot load such file -- rb-inotify
You need to install rb-inotify gem. Use the below command to install it:
gem install rb-inotify
Put this line in Gemfile
gem 'rb-inotify'
and give bundle install then
please give gem list in terminal.
if it is there means to fix this problem require this gem in application.rb like,
require "rb-inotify"
this problem will solve.

rails new <app> or rails -h craps out with cannot load such file -- io/console

[ec2-user#ip-XX-XXX-XXX-XXX rails]$ rails -h
/usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- io/console (LoadError)
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:2:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell/color.rb:1:in `<top (required)>'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/shell.rb:17:in `shell'
from /usr/local/share/ruby/gems/2.0/gems/thor-0.19.1/lib/thor/base.rb:439:in `start'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/commands/application.rb:17:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/cli.rb:14:in `<top (required)>'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/share/ruby/vendor_ruby/2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/bin/rails:9:in `<top (required)>'
from /usr/local/bin/rails:23:in `load'
from /usr/local/bin/rails:23:in `<main>'
I did install Ruby on Rails using $ gem install rails and it completed fine as well. I had checked the process status with $echo $? and it was 0 meaning successful.
Interestingly these two commands work fine:
$ which rails
/usr/local/bin/rails
$ rails -v
Rails 4.1.0
This is a Amazon Web Services AMI image 64 bit. Please help me figure this out.
I have the bundler installed:
$ gem install bundler
Fetching: bundler-1.6.2.gem (100%)
Successfully installed bundler-1.6.2
Parsing documentation for bundler-1.6.2
Installing ri documentation for bundler-1.6.2
Done installing documentation for bundler after 5 seconds
1 gem installed
I checked for duplicate installs:
$ find / 2>/dev/null| grep bin/ruby
/usr/bin/ruby
/usr/bin/ruby2.0
$ find / 2>/dev/null| grep bin/rails
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/bin/rails
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/generators/rails/plugin/templates/bin/rails.tt
/usr/local/share/ruby/gems/2.0/gems/railties-4.1.0/lib/rails/generators/rails/app/templates/bin/rails
/usr/local/share/ruby/gems/2.0/gems/rails-4.1.0/guides/code/getting_started/bin/rails
/usr/local/bin/rails
/home/ec2-user/.gem/ruby/2.0/gems/rails-4.1.0/guides/code/getting_started/bin/rails
You would need to install io-console gem. Install it using following command:
gem install io-console
After this run rails -h
Also, run echo $PATH and make sure that you have /usr/local/bin in the path. If not, then you would need to add it.
So I had resolved this the same night, but somehow Stackoverflow didnt send me any notifications on the responses to the question, so I didnt know of these responses. This is what I ended up doing. It was essentially removing the ruby on rails installation and installing it from scratch. This was on a Amazon Web services server - linux flavor.
sudo yum update
$wget https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer
$ bash -s stable < rvm-installer
$ source /home/ec2-user/.rvm/scripts/rvm
$ rvm requirements
$ sudo yum erase ruby
$ rvm install ruby
$ rvm use ruby --default
$ rvm rubygems current
$ gem install rails # this takes forever
After that it worked just fine.
I had exactly the same issue on AWS Elastic Beanstalk (Puma, Ruby 2, Rails 4.0):
> rails generate simple_form:install --bootstrap
/usr/local/share/ruby/gems/2.0/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- io/console (LoadError)
I simply added:
gem 'io-console'
To the top of my Gemfile and ran bundle install again on the box for great success. Hopefully quicker than reinstalling rails for anyone else who runs in to this.
Thanks; you need io-console indeed. To make that work, install GCC. Rest is needed later on so:
yum -y install gcc mysql-devel ImageMagick-devel
Then,
gem install io-console
works and I could continue installing.

sqlite3-ruby . error

rake aborted!
no such file to load -- sqlite3/sqlite3_native
:33:in require'
<internal:lib/rubygems/custom_require>:33:inrescue in require'
:29:in `require'
i jus keep gettin this error .
info on my system
Ubuntu server 10.04
rails 2.3.8
ruby 1.9.2
sqlite3-ruby 1.3.2 (even installed libsqlite3-ruby1.9.1)
Any solutions on how to deal with this problem .........
have you tried to use a lower version of sqlite3?
do sudo gem uninstall sqlite3-rubyand then do a gem install sqlite3-ruby --version=1.2.5.

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