Incompatible library version puma_http11.so - ruby-on-rails

When I am running rake db:create in my ruby on rails project it's giving me error LoadError: incompatible library version - /home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
Here is full error
tps#tps-H81M-S1:~/sites/my_app$ rake db:create
rake aborted!
LoadError: incompatible library version - /home/tps/.rvm/gems/ruby- 2.3.1/gems/puma-3.6.0/lib/puma/puma_http11.so
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma/server.rb:15:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma- 3.6.0/lib/puma/server.rb:15:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `require'
/home/tps/.rvm/gems/ruby-2.3.1/gems/puma-3.6.0/lib/puma.rb:14:in `<top (required)>'
/home/tps/sites/my_app/config/application.rb:7:in `<top (required)>'
/home/tps/sites/my_app/Rakefile:4:in `<top (required)>'
/home/tps/.rvm/gems/ruby-2.3.1/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
(See full trace by running task with --trace)
Can anyone please help me?
Thanks in advance

Try this(version 3.6.0):
gem uninstall puma
and
bundle
or try this
gem pristine --all
or for specific gem
gem pristine puma

Related

rake aborted! NameError: uninitialized constant ActiveRecord::VERSION error while using rake db:migrate

I am new to ruby on rails. I want to re-create a production setup on my local system for development purposes.I seem to have run into a problem during migration of database.
I am using Ubuntu 18.04 OS. I have installed mysql-server, ruby 2.3.2 , rails 5.0, libmysqld-dev and mysql2 gem successfully. I was able to create a database and import the SQL file for table creation. To do pending migration, I executed rake db:migrate. I am getting the following error.
rake aborted!NameError: uninitialized constant ActiveRecord::VERSION
/home/raj/.rvm/gems/ruby-2.3.2/gems/activerecord-session_store-1.1.1/lib/action_dispatch/session/active_record_store.rb:151:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/gems/activerecord-session_store-1.1.1/lib/active_record/session_store.rb:2:in `require'
/home/raj/.rvm/gems/ruby-2.3.2/gems/activerecord-session_store-1.1.1/lib/active_record/session_store.rb:2:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/gems/activerecord-session_store-1.1.1/lib/activerecord/session_store.rb:1:in `require'
/home/raj/.rvm/gems/ruby-2.3.2/gems/activerecord-session_store-1.1.1/lib/activerecord/session_store.rb:1:in `<top (required)>'
/home/raj/IRIS/config/application.rb:7:in `<top (required)>'
/home/raj/IRIS/Rakefile:4:in `require'
/home/raj/IRIS/Rakefile:4:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/bin/ruby_executable_hooks:24:in `eval'
/home/raj/.rvm/gems/ruby-2.3.2/bin/ruby_executable_hooks:24:in `<main>'
LoadError: cannot load such file -- activerecord-session_store
/home/raj/IRIS/config/application.rb:7:in `<top (required)>'
/home/raj/IRIS/Rakefile:4:in `require'
/home/raj/IRIS/Rakefile:4:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
/home/raj/.rvm/gems/ruby-2.3.2/bin/ruby_executable_hooks:24:in `eval'
/home/raj/.rvm/gems/ruby-2.3.2/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)
Regarding the error in active_record_store.rb line number 151, the code is as follows:
if ActiveRecord::VERSION::MAJOR == 4
require 'action_dispatch/session/legacy_support'
ActionDispatch::Session::ActiveRecordStore.send(:include, ActionDispatch::Session::LegacySupport)
end
During RVM installation rails latest version was also installed somehow. Removing all the gems and doing bundle install worked.
Try running the below mentioned command
gem install activerecord
Hope this helps.
Can you add this to the top of active_record_store.rb to see if it works?
require 'active_record/version'

db:migrate not working after cloning the source code

i cloned the sample app from https://bitbucket.org/railstutorial/sample_app_4th_ed and followed the instruction there, but rails db:migrate is aborting
C:\Sites\sample_app>rails db:migrate
rails aborted!
LoadError: cannot load such file -- bcrypt_ext
C:/Sites/sample_app/config/application.rb:7:in `<top (required)>'
C:/Sites/sample_app/Rakefile:4:in `require_relative'
C:/Sites/sample_app/Rakefile:4:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.3/bcrypt_ext
C:/Sites/sample_app/config/application.rb:7:in `<top (required)>'
C:/Sites/sample_app/Rakefile:4:in `require_relative'
C:/Sites/sample_app/Rakefile:4:in `<top (required)>'
bin/rails:9:in `require'
bin/rails:9:in `<main>'
(See full trace by running task with --trace)
Try to uninstall bcrypt completely with:
gem uninstall bcrypt-ruby
gem uninstall bcrypt
Be sure all versions are uninstalled, then run
gem install bcrypt --platform=ruby
Try to run bundle install. After this worked you could try to run rake db:migrate again.

Installing Ruby on Rails: -bash: bundle: command not found

Having an issue running bundle in my application, I have copied the commands and logs, and display below.
$ cd ~/Desktop/chinook/
$ rake db:setup
rake aborted!
Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 10.4.2. Prepending `bundle exec` to your command may solve this.
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:34:in `block in setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:19:in `setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/setup.rb:8:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/boot.rb:4:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/application.rb:1:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/Users/kexinwu/Desktop/chinook/config/boot.rb:4:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/application.rb:1:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
Then after seeing that error I ran this command:
$ gem install rake -v 10.4.2
WARNING: You don't have /Users/kexinwu/bin in your PATH,
gem executables will not run.
Successfully installed rake-10.4.2
Parsing documentation for rake-10.4.2
Done installing documentation for rake after 1 seconds
1 gem installed
Kexins-MacBook-Pro:chinook axiner$ rake db:setup
rake aborted!
Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 10.4.2. Prepending `bundle exec` to your command may solve this.
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:34:in `block in setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:19:in `setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
/Users/kexinwu/.gem/ruby/2.3.0/gems/bundler-1.11.2/lib/bundler/setup.rb:8:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/boot.rb:4:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/application.rb:1:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/Users/kexinwu/Desktop/chinook/config/boot.rb:4:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/config/application.rb:1:in `<top (required)>'
/Users/kexinwu/Desktop/chinook/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
$ bundle exec rake db:setup
-bash: bundle: command not found
How do I fix this error where I can run rake db:setup?
You need to install bundler, then you can use the bundle command.
gem install bundler
Try this command bundle exec
bundle exec rake db:setup

Rake aborted, cannot load file ./bundler/setup, ruby require errors in RubyOnRails application

I've been working on a Ruby on Rails project for class and have run into some problems. When I run bundle install, all of my gems install appropriately. When I run rake db:setup, I get the following error.
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ rake db:setup
rake aborted!
cannot load such file -- ./bundler/setup
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:6:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I am also get this error when I try to run any of my unit tests:
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ ruby test/unit/user_test.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require': cannot load such file -- ./bundler/setup (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:6: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 /home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1: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 /home/tuggernuts2/Workspace/Class/baseball-manager/config/environment.rb:2: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 /home/tuggernuts2/Workspace/Class/baseball-manager/test/test_helper.rb:2:in `<top (required)>'
from test/unit/user_test.rb:2:in `require_relative'
from test/unit/user_test.rb:2:in `<main>'
I'm working on this project with a group of 4 others, and no one else is getting these errors so I infer that the problem is with my setup and not with the code.
I'm running ruby version "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"
I'm running ruby gems version 1.8.23
I'm running rails version 3.2.5
but when I run rails -v I get the same require error, and the same ./bundler/setup error as above. I've been googling these problems for awhile and non of the solutions I've found so far have helped.
I've tried re-installing gems, I've tried running gem update -system, but that just gives me:
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.
The rake errors are new as of yesterday, the ruby require errors have been there pretty much since the beginning. Life has been a struggle.
I've tried a bunch of combinations of require, require "./...", require_relative, and nothing seems to fix the require errors.
Any and all help is appreciated. Thanks in advance.
Edit: Output from: bundle exec rake db:setup --trace
tuggernuts2#tn-Extensa5620:~/Workspace/Class/baseball-manager$ bundle exec rake db:setup --trace
rake aborted!
cannot load such file -- ./bundler/setup
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:7:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/boot.rb:7:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/config/application.rb:1:in `<top (required)>'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `require'
/home/tuggernuts2/Workspace/Class/baseball-manager/Rakefile:5:in `<top (required)>'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/var/lib/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/var/lib/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'

Activated Ruby RAKE 10.0.1, require 10.0.0

I get this error when i try to run "rake test":
avery#ubuntu:~/rails_projects/depot$ rake test
rake aborted!
You have already activated rake 10.0.1, but your Gemfile requires rake 10.0.0. Using bundle exec may solve this.
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:31:in `block in setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:17:in `setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler.rb:116:in `setup'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/setup.rb:7:in `<top (required)>'
/home/avery/rails_projects/depot/config/boot.rb:6:in `<top (required)>'
/home/avery/rails_projects/depot/config/application.rb:1:in `<top (required)>'
/home/avery/rails_projects/depot/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
when i try running "bundle exec rake" i get:
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes.
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `<top (required)>'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/home/avery/.rvm/gems/ruby-1.9.3-p327/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/home/avery/rails_projects/depot/config/application.rb:7:in `<top (required)>'
/home/avery/rails_projects/depot/Rakefile:5:in `require'
/home/avery/rails_projects/depot/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
how can i fix this?
You probably have rake 10.0.0 in your Gemfile.lock.
Removing Gemfile.lock might solve the problem.
For the first part of the question: I ran into the same problem and solved it with a:
gem regenerate_binstubs
after that
gem -V
reveals 10.0.0 again.
Answer of 1st query
In your Gemfile, explicitly set the latest rake version by
gem 'rake', '~> 10.0.1'
And then run
$ bundle update rake
Answer of 2nd query
put this in your Gemfile and run bundle install
gem 'therubyracer'
For the second part of the question, you just need to add this to your Gemfile:
gem 'therubyracer'
If you've specified a rake version in your Gemfile that your project requires, eg:
gem 'rake', '~> 10.0.0'
Try installing it again
bundle install

Resources