I am running rails in windows 10 and when I try to log in I'm getting bcrypt load error. I used to get this error before but I used to solve it. But this time I am not able to. I have tried all the solution by installing bcyrpt gem but nothing is working for me. I am stuck with this. Can anybody help me
I have referred this before
Ruby on windows causes error Cannot load such file bcrypt_ext
For Windows 10, try to use bcrypt 3.1.11
Uninstall older bcrypt and bcrypt-ruby
Install it again by adding following line in Gemfile
gem 'bcrypt', '~> 3.1.11'
Then bundle install
Related
I am trying to create new demo rails program, as guide in my book as this command
rails new demo
then it gave me this error
https://imgur.com/rUSzO4B
It said that my problem is
Could not find gem sqlite3 <> 1.4 x86-mingw32 in any of the gem sources listed in your Gem file
and I must run
bundle install
to solve it
I ran bundle install , but nothing changed.
I know my question maybe too easy to solve, but I am very stuck with this, could you please give me some ideas?
From the documentation of the bootsnap gem in rails: "This gem works on macOS and Linux." See: https://github.com/Shopify/bootsnap
They seem to have found a workaround here:
How can I properly install bootsnap on windows
Add or change to gem 'bootsnap', '=1.4.1', require: false to your project Gemfile
Error
I have tried running the following command in git bash
rails g scaffold_controller oragnizationsController
And I get the error in the picture.
I have tried multiple solutions:
1- Tried running
gem install wdm
2- Tried running
bundle install
3- I have tried adding
gem 'wdm', '~> 0.1.0'
and
gem 'wdm', '~> 0.1.1'
since I read that 0.1.0 ain't working anymore.
But the problem hasn't been solved yet. I am using windows 10, ruby 2.3.3, rails 5.1.4
Uninstall wdm gem and put it to the gemfile like this:
gem 'wdm' if Gem.win_platform?
Or like the error tells you
The message about wdm is misleading here. It seems to be just a notice/warning.
If you look closer, you'll see that the actual error message is printed in the line below that. It says:
cannot load such file -- bcrypt_ext (LoadError)
Then see here: Ruby on windows causes error Cannot load such file bcrypt_ext
I'm having problems with bcrypt when either trying to start my rails server or attempting to login on the localhost.
I have played around by re-downloading/updating my Gem file with different versions of bcrypt and moving files around as per some of the github issues raised around this.
At the moment, my rails server starts, and when I login I get the error:
cannot load such file — 2.3/bcrypt_ext
And my Gem file has: gem 'bcrypt-ruby', '~> 3.0.0'
Any thoughts to get this working consistently on Windows?
Came across this github issue and the following seems to work
Firstly uninstall bcrypt and bcrypt-ruby by running these two commands:
gem uninstall bcrypt and gem uninstall bcrypt-ruby
Install it again with gem install bcrypt --platform=ruby
In your Gemfile write gem 'bcrypt-ruby', '3.1.5', :require => 'bcrypt'
Run bundle install
Okay I got this working by referring to the following answer: https://stackoverflow.com/a/33593911/6676900
The key steps are as follows:
1. Install Devkit from - http://rubyinstaller.org/downloads/ (NOTE: I had to use the 32 bit version even though I am running Windows 10 64 Bit)
2. Update my PATH variable to use the 32bit version of the Dev kit. i.e. %DEVKIT_HOME%\bin (Where %DEVKIT_HOME% is the location of the extracted Dev Kit)
3. Follow the commands in the following answer: https://stackoverflow.com/a/33593911/6676900
Good to go!
I am trying to load (require) the httparty gem into a Ruby file but keep getting an error and am unsuccessful.
Below is the error copied:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- httparty (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/neilricci/Desktop/test.rb:1:in `<main>'
Below is where the httparty gem file is located on my computer:
/Users/neilricci/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/httparty-0.13.7/lib/httparty.rb
Issue was resolved by installing httparty with sudo, which is weird because I installed httparty as the main admin.
sudo gem install httparty
How are you requiring the HTTParty gem in your code? Sometimes an error occurs when you're including your gems with capital letters, that's to say a require "HTTParty" will be clearly different than require "httparty".
It can produce a 'require': cannot load such file -- HTTParty (LoadError), what's a name difference; possible solution is to refer your gem require in complete lowercase letter.
Another possible cause could be that your ruby version isn't compatible with what the gem needs, maybe you're running your piece of code with a previous version minor than what the gem needs to work; possible solution is to check what's the Ruby version dependency of the gem that's giving you problems, at the time of writing this the last version of HTTParty is the 0.14.0 what requires a version of Ruby equal or more actual than 1.9.3 (>= 1.9.3)
If your HTTParty gem version is old you're going to receive error messages with undefined methods, here the solution is obvious, check what version do you have and uninstall it using sudo gem uninstall httparty-gem and then install the new version using sudo gem install httparty-gem (sudo is to prevent possible future errors with the propietary who has installed the gem), or if you want you can just install it and have those two or more versions of the gem.
In my case I had put require 'httparty' on my class but still give me an error. I tried to Install and Uninstall httparty gem without any progress. Finally I could resolve the problem by adding gem 'httparty' line to my Gemfile file followed by running bundle install from command prompt.
I am using rails 5.2.3 with ruby 2.5.1
Try installing the gem:
gem install httparty
Your code seems to be running in Ruby 2.0.0, but the gem seems to be installed for Ruby 2.2.3.
Make sure your Ruby version is properly selected through rvm or chruby or whatever you personally use to manage your Ruby versions, and make sure the HTTParty is installed for the same version your code is running in.
Remove the code require 'httparty' wherever you have added.
I'm using database authentication in devise(current gem) on rails 3 and I get the following error when trying to log in with username/password.
no such file to load -- bcrypt_ext
This error occurred while loading the following files:
bcrypt
bcrypt_ext
I have previously "Successfully installed bcrypt-ruby-2.1.2" gem.
Any ideas? I also tried giving bundler the git repo address and fetching the master, but it doesn't solve the issue.
I had this problem as well. When I installed the gem, the output told me
Building native extensions. This could take a while...
Successfully installed bcrypt-ruby-3.0.1
so I assumed that it had, in fact, built native extensions. But when I went hunting in .../gems/bcrypt-ruby-2.1.4/ext/mri I saw that it not appear to have built anything.
I manually went in and ran
cd [path to your gems folder]/gems/bcrypt-ruby-2.1.4/ext/mri
ruby extconf.rb
make
sudo make install
This did the trick for me.
Do you have these in your Gemfile?
gem "bcrypt-ruby", :require => "bcrypt"
Also -- this issue on devise might apply, check it out
I had the same problem.
add in gemfile:
gem "bcrypt-ruby", '~> 3.0.0'
try bundle install and then bundle update bcrypt-ruby
I had the same issue, i simply deleted the vendor directory and did bundle install.
Fixed the problem. Maybe theres a problem in the make where it won't overwrite.
Check out your Gemfile. See whether you have "bcrpyt-ruby" gem or not. If it is not there then add "bcrpyt-ruby" gem.
gem "bcrypt-ruby", :require => "bcrypt"
I too had the same issue, this resolved it-
gem 'bcrypt', '~> 3.1.9'