LoadError: cannot load such file — bcrypt_ext - ruby-on-rails

I have tried to deploy devise authentication on my rails app.
I am getting this issue
"cannot load such file -- bcrypt_ext"
I see it is a common issue amongst windows based computers but the answers to other questions have not helped me yet.
I am running Windows 8 x64 with x86 ruby and devkit

try
C:\> gem install --no-ri --no-rdoc bcrypt
C:\> cd (path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> ruby extconf.rb
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make
C:\(path to gems root)\bcrypt-3.1.7-x86-mingw32\ext\mri> make install
reference: https://www.alib.jp/entries/bcrypt_ext_load_error_on_ruby21x

bcrypt_ext.so file is missing -if you manually copy it to proper folder - in my case \Ruby23\lib\ruby\gems\2.3.0\gems\bcrypt-3.1.11-x86-mingw32\lib - it helps. :)

This worked for me:
https://github.com/codahale/bcrypt-ruby/issues/142
-Uninstall all bcrypt versions: gem uninstall bcrypt
select option 3 (uninstall all)
-Uninstall all bcrypt-ruby versions: gem uninstall bcrypt-ruby
select option 3 (uninstall all)
replace the line in your gemfile by:
to add this line to the gemfile:
gem 'bcrypt', platforms: :ruby
did not work for me though but to point the gemfile to the git repository did:
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
bundle install
and you should be good to go

At this link https://github.com/codahale/bcrypt-ruby/issues/142
Somebody mentioned this solution
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
And it worked for me

Related

'bundle install' keeps installing gem sqlite3 version 1.4.2 even if not in Gemfile

I need sqlite3 v1.3.9 gem installed for my app, so I add this line to the Gemfile:
gem 'sqlite3', '= 1.3.9'
However, when I run 'bundle install', it installs v1.4.2 of that gem.
I modified the above line to
gem 'sqlite3', '= 1.3.9', '< 1.4'
No joy -- sqlite v1.4.2 is installed (even if I remove any reference to 'sqlite3' from the Gemfile completely).
My Gemfile was created when I used rails new appname, so it is not fancy at all... I only added gem devise to it.
Gemfile.lock doesn't contain any reference to sqlite3. I removed it anyway and it didn't help.
As another option, I installed v1.3.9 via gem install sqlite3 -v 1.3.9 and I removed v1.4.2 with
# bundle exec gem uninstal sqlite3
Select gem to uninstall:
1. sqlite3-1.3.9
2. sqlite3-1.4.2
3. All versions
> 2
Successfully uninstalled sqlite3-1.4.2
...but as soon as I tried to add v1.3.9, I got:
# bundle add sqlite3 -v 1.3.9
[!] There was an error parsing `injected gems`: You cannot specify the same gem twice with different version requirements.
You specified: sqlite3 (~> 1.4) and sqlite3 (= 1.3.9). Bundler cannot continue.
# from injected gems:1
# -------------------------------------------
> gem "sqlite3", "= 1.3.9"
# -------------------------------------------
I'd grateful for any hints on why v1.4.2 keeps being installed and, most importantly, how do get the bundler forget about v1.4.2 and accept v1.3.9?
Thanks a lot!
There might be some gem in your app that requires sqlite3-1.4.2 and that is causing an issue with installing sqlite3-1.3.9. You should check your Gemfile.lock and look for any gem that is adding sqlite3-1.4.2 as a dependency.
There should be a gem in your app that requires sqlite3-1.4.2 and that is causing an issue with installing sqlite3-1.3.9. You should check your Gemfile.lock and look for any gem that is adding sqlite3-1.4.2 as a dependency.

Cannot install gem march_hare

I tried adding this to my Gemfile:
gem 'march_hare', '~> 2.22'
Using bundle install I got this message:
Could not find gem 'march_hare (~> 2.22)' in any of the gem sources listed in
your Gemfile or available on this machine.
On the topmost line in my Gemfile, I have this :
source 'https://rubygems.org'
When I manually visit the rubygems and I m able to find this gem here :
https://rubygems.org/gems/march_hare
How do I install this gem? I don't understand what is happening.
It doesn't work with any jRuby older than 9.0, this was a miss on my part

Could not find gem 'aws-3' in any of the gem sources listed in your Gemfile or available on this machine

I'm new to RoR and I keep getting this error when trying to install Amazon gem aws-3:
Could not find gem 'aws-3' in any of the gem sources listed in your Gemfile or available on this machine.
I'm using Rails 5.
The gem per se appears to successfully be installed:
$ gem install aws-s3
Successfully installed aws-s3-0.6.3
Parsing documentation for aws-s3-0.6.3
Done installing documentation for aws-s3 after 1 seconds
1 gem installed
Added it to my Gemfile:
gem 'aws-3', :require => 'aws/s3'
On the top of the Gemfile I have listed:
source 'https://rubygems.org'
You misspelled aws-s3 as aws-3in the Gemfile. It should be
gem 'aws-s3', :require => 'aws/s3'
Note: There's no gem which goes by the name aws-3. That is why you were getting the error.
As told by #Arun Kumar,
you need to add aws-s3 gem in your gemfile.Here is the github

bcrypt error: Devise ruby 2.0 and rails 4.0

I keep getting this error when i try to run my app:
C:/ruby-2.0.0-p195-i386-mingw32/lib/ruby/gems/2.0.0/gems/activesupport-4.0.0.rc1
/lib/active_support/dependencies.rb:228:in `require': cannot load such file -- 2
.0/bcrypt_ext (LoadError)
Any takers? - im trying to use the devise gem for basic user authentication..
I've gotten this error when I updated to Ruby 2.0.0+ on Windows. I was able to solve it by uninstalling all versions of bcrypt that were downloaded, and building the gem using DevKit.
gem uninstall bcrypt-ruby
gem install bcrypt-ruby --platform=ruby --no-ri --no-rdoc
Usually doing a bundle update will download a precompiled gem mingw32 extension, which in this case appears not to work. This workaround for reinstalling bcrypt-ruby will hopefully not be needed in the future.
Additionally, I keep updated Windows installation instructions for Ruby on Rails here (mostly for my own reference) for installing Ruby on Rails on Windows.
https://github.com/remomueller/documentation/tree/master/windows
Some other Windows pitfalls you may run into are also listed there:
https://github.com/remomueller/documentation/blob/master/windows/190-miscellaneous.md
Until this problem is fixed, the best workaround is to install bcrypt-ruby from git:
gem 'bcrypt-ruby', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
Update (June 2016.) - as #gneri mentioned, bcrypt-ruby changed it's name to bcrypt, so use:
gem 'bcrypt', git: 'https://github.com/codahale/bcrypt-ruby.git', :require => 'bcrypt'
On problem with has_secure_password on Window 7 helps this
gem uninstall bcrypt-ruby
gem uninstall bcrypt
gem install bcrypt-ruby --platform=ruby --no-ri --no-rdoc
gem install bcrypt --platform=ruby --no-ri --no-rdoc
Add to Gemfile:
gem 'bcrypt-ruby', '~> 3.0.0', :require => 'bcrypt'
gem 'bcrypt'
bundle install
turns out that it was a problem with the version of ruby that i was using. I was using ruby 2 (32bit).
but if you switch to the 64bit version of ruby 2 the error goes away.
Seems like the downfall of using windows as a development platform for ROR apps. I need to use Ruby 2.0 32 bit in order to get PG gem for a postgresql connection to work or I have to use Ruby 2.0 64 bit to get 'Devise' gem to work.
The new version of bundler just came out. It nows about x64 gems
gem install bundler -v '1.4.0.pre.2'

Bundle install doesn't work

I'm trying to install all gems in a gemFile of a project, but when i typed:
sudo bundle install
but i got this error:
Could not find gem 'llrp_connector (>= 0)' ruby in any of the gem sources listed in your Gemfile.
Anyone have an idea ?
Have you added this line on the top of your Gemfile?
source 'http://rubygems.org'
EDIT
As Dylan said, this gem doesn't exist on RubyGems.org. If it is a gem hosted on a (private) repository, add it this way :
gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git", :branch => "1.4"

Resources