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!
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
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
I'm working on a new project in Ruby, which I'm learning, and I need to install Sinatra gem and I'm getting the following error:
"Following gems were not installed: sinatra-sinatra (0.10.1): While
executing gem ... (Gem::UnsatisfiableDependencyError)
Unable to resolve dependency: 'sinatra-sinatra (= 0.10.1)' requires 'rack (>= 1.0)'"
Currently I'm using, RubyMine (Windows). Any help would be appreciated.
Thanks
The problem is not RubyMine, but some other dependency conflict in your app. The gem sinatra-sinatra requires Rack 1.0, there is probably another gem in your Gemfile that requires a greater or different version of the same gem.
Actually, I believe your problem can easily be fixed by using the proper gem. sinatra-sinatra is a very old gem, if you want to use the Sinatra framework the correct gem is sinatra. Update your Gemfile accordingly.
In you machine
gem install sinatra-sinatra
Check you Gemfile
gem 'sinatra-sinatra', '~> 0.10.1'
Delete the Gemfile.lock and bundle its once again.
I am trying to connect Rails to Sql Server so I need to use an Sql Server adaptor. I installed it by downloading the adaptor locally from github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapter.git. After that I did: gem build activerecord-sqlserver-adapter.gemspec in the directory where I had the spec file, followed by gem install <name of gem that was just built>.
After that, I added this line in the gemfile:
gem 'activerecord-sqlserver-adapter', :path => 'downloads/activerecord-sqlserver-adapter-master\activerecord-sqlserver-adapter-master' , then I ran a bundle install from the project root.
The error is:
Bundler could not find compatible versions for gem "activerecord": In
Gemfile: rails <=4.1.6> x86-mingw32 depends on activerecord <=4.1.6>
x86-mingw32
activerecord-sqlserver-adapter <>=0> x86-mingw32 depends on
activerecord <4.0.0>
What is strange is rails -v doesn't return the rails version although I just installed it.
Instead it throws:
Could not find gem 'tzinfo-data <>=0> x86-mingw32 in the gems available on this machine
Run bundle install to install missing gems
I should specify we are compulsed to use proxies at work
Every few month I keep checking to see if the Sql Server connection is improved/easier to perform with Rails without adaptors and such, because I want to use Sql Server instead of PostgreSQL. No luck so far. Any help is much appreciated. Thanks
It looks like the gem that you are using only supports until rails 4.0.0 (the gemspec forces to be this version).
You might try to use that rails version to see what's going on.
To do so, in your Gemfile.rb you can try this:
gem 'rails', '4.0.0'
gem 'activerecord-sqlserver-adapter', git: 'https://github.com/Desarrollo-CeSPI/activerecord-sqlserver-adapter.git'
and then run
bundle update rails # to force using the rails version specified in the gemfile
and then run
bundle install
BUT
The gem that you are using has not been updated since 22nd August 2013, so I would not expect it work.
The gem that you are using is a fork of the original project located at https://github.com/rails-sqlserver/activerecord-sqlserver-adapter
If you don't have anything to do with Desarrollo-CeSPI, then you should use the official gem to avoid some problems, for instance that the gem is not maintained anymore.
I like django, unfortunately i have to use RoR for 2 projects, and it seems like I'm having problems from the start :P
how to install nifty-generators on xp? i found 3 solutions out there, none works for me :P
1- use sudo gem install nifty-generators which won't work obviously
2- gem 'nifty-generators', '>= 0.4.6' .......... the output is
Error: while executing gem ...(RuntimeError)
unknown command nifty-generators,
3- gem "nifty-generators", :group => :development would give that same error
i'm using rails 3, windows xp pro, 32 bit, sp3, installed ruby on rails using railsinstaller
I am not familiar with Windows, so I can't advise the first method.
You don't just type 2 and 3 in the terminal, they are to be added to your Gemfile in the root of your rails app. After saving your Gemfile, you can run bundle install from the terminal to install the gem. It will then be available for use in your rails app.