Bcrypt error when installing the devise gem - ruby-on-rails

When trying to run bundle install after adding
gem 'devise', '~> 4.8', '>= 4.8.1' in Gemfile will show the below error
An error occurred while installing bcrypt (3.1.18), and Bundler cannot continue.
Are there any steps before using it?
Rails 7.0.4
ruby 3.1.2
Please how can solve I it?
Thank you

Related

Issue when running Rails server

I have this error message when i run rails server.
cannot load such file -- bcrypt_ext (LoadError)
Please help
Error message snipet
Try uninstalling bcrypt with gem uninstall bcrypt and gem uninstall bcrypt-ruby.
Then reinstall with gem install bcrypt --platform=ruby and add this to your gemfile gem 'bcrypt', platforms: :ruby

Could not find coffee-script-source-1.1.3 in any of the sources

Hi I'm doing Rails app and when I bundle install it returns an error:
Could not find coffee-script-source-1.1.3 in any of the sources
I know that coffee-script-source-1.1.3 gem is deprecated/yanked but my other gems are having dependencies with this.
But this project is working with other machine and in heroku production.
How can I successfully bundle install this without changing my gemfile?
Thanks
Run this:
bundle update --source coffee-script-source
If you get an error, like this:
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Run this:
gem install rmagick
I hope it'll help you.
What it worked for me was to update the gem to 1.2.0.
As it shows here https://rubygems.org/gems/coffee-script-source/versions
1.1.3 says that it's yanked.
gem 'coffee-script-source', '~> 1.2.0'
And run
bundle update --source coffee-script-source

Error message: You have requested: bcrypt-ruby ~> 3.0.1 The bundle currently has bcrypt-ruby locked at 3.0.1.

I am running my ruby on rails app on amazone elastic beanstalk but I am having the error as stated in the title.
I am using has_secure_password, hence I've uncommented the following inside my gemfile
gem 'bcrypt-ruby', '~> 3.0.0'
I pushed my code to elastic beanstalk and got the following erorr:
You have requested: bcrypt-ruby ~> 3.0.0
The bundle currently has bcrypt-ruby locked at 3.0.1.
Try running `bundle update bcrypt-ruby` (Bundler::GemNotFound)
I've tried changing my gem to the following but it doesn't work either.
gem 'bcrypt-ruby', '~> 3.0.1'
I managed to solve it by modifying Gemfile.lock file. I changed
specs:
bcrypt-ruby (3.0.1-x86-mingw32)
into
specs:
bcrypt-ruby (3.0.0)
I encountered other library issue, what I did is the same as above, removing mingw32.

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'

Getting error while installing lincache19 in rails project

i am using ruby 1.8.7 and rails 3.0.12 for my project.
when i run "bundle install", i get the following error.
Gem::InstallError: linecache19 requires Ruby version >= 1.9.2.
An error occurred while installing linecache19 (0.5.12), and Bundler cannot continue.
i don't want to change my ruby version.
You can try using the debugger gem instead of ruby-debug. Check out your gemfile and replace gem "ruby-debug" with gem "debugger". From memory that's how I did it.
Replacing gem 'ruby-debug19' with gem 'ruby-debug' worked for me.

Resources