Cannot load such file -- 2.4/bcrypt_ext - mysql

I am trying to run rails s on my project but when I do this error pops up:
C:/ror/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10-x64-mingw32/lib/mysql2/2.4/mysql2.so: warning: constant ::TimeoutError is deprecated
rails aborted!
LoadError: cannot load such file -- bcrypt_ext
c:/ror/dev/AWI/config/application.rb:8:in `<top (required)>'
c:/ror/dev/AWI/Rakefile:5:in `require_relative'
c:/ror/dev/AWI/Rakefile:5:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Caused by:
LoadError: cannot load such file -- 2.4/bcrypt_ext
c:/ror/dev/AWI/config/application.rb:8:in `<top (required)>'
c:/ror/dev/AWI/Rakefile:5:in `require_relative'
c:/ror/dev/AWI/Rakefile:5:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
(See full trace by running task with --trace)
When I look at the gem list I have bcrypt (3.1.12, 3.1.11 x64-mingw32) installed.
My Gemfile had this gem in it gem 'bcrypt', '~> 3.1.7' and I switched it to gem 'bcrypt', '~> 3.1.11' which still didn't work.
I am running this project using Ruby 2.4.2, Rails 5.1.4, mysql 8.0.11. Any ideas on how I can get my rails s command to operate.

Related

Setting up gemfile for Jekyll - unclear what is wrong

I'm trying to setup a gh-pages site with Jekyll.
When running jekyll server I run into the following error message:
10: from /Users/a56z/.rbenv/versions/2.6.3/bin/jekyll:23:in `<main>'
9: from /Users/a56z/.rbenv/versions/2.6.3/bin/jekyll:23:in `load'
8: from /Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
7: from /Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
6: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler.rb:107:in `setup'
5: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `setup'
4: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:26:in `map'
3: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:148:in `each'
2: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/spec_set.rb:148:in `each'
1: from /Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:31:in `block in setup'
/Users/a56z/.gem/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:319:in `check_for_activated_spec!': You have already activated i18n 1.6.0, but your Gemfile requires i18n 0.9.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError) ```
My Gemfile looks as follows:
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
gem 'github-pages'
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
source 'https://rubygems.org'
gem 'jekyll', '3.8.6'
group :jekyll_plugins do
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
end```
Please advise what I'm missing, I've been searching the web but couldn't find anything to make this work.
Also running bundle exec jekyll server doesn't work
I have also simplified the gemfile to this:
gem "jekyll"
gem "minima"
group :jekyll_plugins do
gem "jekyll-feed"
end
but even like so I get this error:
Configuration file: /Users/a56z/code/a56z/blog/my_pytter_blog/_config.yml
Source: /Users/a56z/code/a56z/blog/my_pytter_blog
Destination: /Users/a56z/code/a56z/blog/my_pytter_blog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.229 seconds.
Auto-regeneration: enabled for '/Users/a56z/code/a56z/blog/my_pytter_blog'
bundler: failed to load command: jekyll (/Users/a56z/.rbenv/versions/2.6.3/bin/jekyll)
Errno::EADDRINUSE: Address already in use - bind(2) for 127.0.0.1:4000
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:201:in `bind'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:201:in `listen'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:764:in `block in tcp_server_sockets'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:227:in `each'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:227:in `foreach'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/socket.rb:762:in `tcp_server_sockets'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/webrick/utils.rb:65:in `create_listeners'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/webrick/server.rb:127:in `listen'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/webrick/server.rb:108:in `initialize'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/2.6.0/webrick/httpserver.rb:47:in `initialize'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:215:in `new'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:215:in `start_up_webrick'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:102:in `process'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
/Users/a56z/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
/Users/a56z/.rbenv/versions/2.6.3/bin/jekyll:23:in `load'
/Users/a56z/.rbenv/versions/2.6.3/bin/jekyll:23:in `<top (required)>'

mysql2 GemRequireError during server start

I'm trying to get an old Ruby on Rails project up and running. The project uses Ruby 1.9.3p484 and a bunch of gems, including mysql2, that are all successfully installed when I run bundle install. However, when I run a script/rails server (like I said, old version of RoR), I get the following mysql2 error:
/Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:81:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)
and the stack trace:
/Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:81:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'mysql2'. (Bundler::GemRequireError)
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /Users/ryan/vagrant/source/adage/web/htdocs/iwny/config/application.rb:8:in `<top (required)>'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/railties-3.0.20/lib/rails/commands.rb:28:in `require'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/railties-3.0.20/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/railties-3.0.20/lib/rails/commands.rb:27:in `tap'
from /Users/ryan/.rvm/gems/ruby-1.9.3-p484#iwny/gems/railties-3.0.20/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Like I said, bundle install worked just fine. The Gemfile contains
gem 'mysql2', '< 0.3'
and versions for various software include the following:
ruby 1.9.3p484
rails 3.0.20
rake 10.0.3
rspec 2.12.2
rake-compiler 10.5.0
mysql: Server version: 5.5.44-37.3-log Source distribution
I can't really mess with too much core stuff as this is an established site/repo so I have to work with what I have here.

Rails on Mac - rake db:create error

I installed RVM and rails on my MAC (Mavericks 10.9.1) and I try to run rake db:create. However I constantly get this error:
MacBook-Pro-Szymon:wybierzto Fengson$ rake db:create
rake aborted!
dlopen(/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient_r.16.dylib
Referenced from: /Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
Reason: image not found - /Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top (required)>'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/config/application.rb:12:in `<top (required)>'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `require'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `<top (required)>'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
Also, how can I properly install MySQL Server so that I can set a default password? It asked me for a password on Windows machine but here it didn't when I was installing MySQL5 + server. Thanks!
try reinstall mysql through homebrew. and reinstall mysql gem
gem install mysql -- --with-mysql-config path/to/mysql_config

Getting errors when starting a rails server with MySQL on mac os

I've been tinkering with this one for several days and I still get the same error. For starters, I have been able to start a newly rails app with sqlite as the database but the application we are working on uses Mysql. So when I go to the app directory and type "rails server" it gives me the following:
/Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /Users/gojinjedi/Sites/bluey/config/application.rb:7:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
So (I think) MySQL development headers aren't installed, which I googled everywhere how to install them and tried most install command line to no success yet. Examples of commands I've tried:
gem install mysql2
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
I did the bundle install, bundle update and bundle commands in the app directory...I'm running out of options...can you help me?
I'm on mac osx 10.7
have you tried something like this, I'm one Mac OS X (lion) too and I have no problem with the mysql gem. Or may be you can find what you want here
[EDIT]
Or you can simply use ruby-mysql gem for development environment

Problem with MySQL and Rails Server

Final edit: I played with a few different files got some more errors and then reinstalled rvm and everything else from the start, found a few fixes and edited them and finally everything works. thank you everyone for your help
Edit: I have noticed that it says Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)
But I have mysql 5.5.11, how do I fix that?
I literally have searched for the past 3 hours, but found nothing that worked
Same error occurs when I either try to launch the server or generate a model
I have bundler and mysql2 gems.
builder (2.1.2)
bundler (1.0.12)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.17)
mime-types (1.16)
mysql2 (0.2.7)
I get the following output:
hrs772:demo kishinmanglani$ rails s
/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
from /Users/kishinmanglani/rails_projects/demo/config/application.rb:7:in `<top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Whenever you get load errors you should make sure you have all of the dependencies installed and in place.
Make sure you have gem mysql2 in your Gemfile.
Install bundler if you don't already have it with gem install bundler.
Run bundle (same as bundle install).
Then try running the server again.
mysql2 with rails 3.0.3 is give some error so try to update rails version with 3.0.6
it working fine so try