The following error occurred while executing the project after git clone, yarn install and bundle install.
Error logs
Sprockets::FileNotFound in Users::Sessions#new
Showing /Users/{...}/Desktop/{my_project_dir}/app/views/users/sessions/new.html.erb where line #9 raised:
couldn't find file 'angular/1.8.0/angular' with type 'application/javascript'
Checked in these paths:
/Users/{...}/{my_project_dir}/app/assets/config
/Users/{...}/{my_project_dir}/app/assets/fonts
/Users/{...}/{my_project_dir}/app/assets/images
/Users/{...}/{my_project_dir}/app/assets/javascripts
/Users/{...}/{my_project_dir}/app/assets/stylesheets
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/app/assets/images
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/app/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/app/assets/stylesheets
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/vendor/assets/fonts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/vendor/assets/images
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/vendor/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rails_admin-2.0.2/vendor/assets/stylesheets
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/remotipart-1.4.4/vendor/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/nested_form-0.3.2/vendor/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/jquery-ui-rails-6.0.1/app/assets/images
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/jquery-ui-rails-6.0.1/app/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/jquery-ui-rails-6.0.1/app/assets/stylesheets
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/jquery-rails-4.4.0/vendor/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/apidoco-1.6.2/app/assets/config
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/apidoco-1.6.2/app/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/apidoco-1.6.2/app/assets/stylesheets
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/coffee-rails-4.2.2/lib/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actioncable-6.0.3.4/app/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/activestorage-6.0.3.4/app/assets/javascripts
/Users/{...}/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/actionview-6.0.3.4/lib/assets/compiled
/Users/{...}/{my_project_dir}/node_modules):
6:
7: <div class="text-center w-75 m-auto">
8: <a href="/">
9: <span><img src="<%= image_url('bi.png') %>" alt="" height="50" /></span>
10: </a>
11: <p class="text-muted mt-3"> Title description </p><p class="text-muted"></p>
12: </div>
I don't understand why couldn't find file 'angular/1.8.0/angular' with type 'application/javascript' is happened.
Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.7.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
# Use sqlite3 as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
# gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
gem 'image_processing', '~> 1.2'
# Json Serializer
gem 'fast_jsonapi'
# api docs
gem 'apidoco'
# admin
gem 'rails_admin', '~> 2.0'
# control cors
gem 'rack-cors'
# pagination
gem 'kaminari'
gem 'will_paginate', '~> 3.1.0'
# api call
gem 'rest-client'
# user and admin
gem 'devise'
gem 'devise-jwt'
gem 'omniauth-oauth2'
gem 'omniauth-google-oauth2'
gem 'omniauth-naver'
gem 'devise-i18n'
# manage role
gem 'cancancan'
gem 'rolify'
# active storage
gem 'active_storage_validations'
gem 'aws-sdk-s3'
# Use ActiveStorage variant
gem 'mini_magick', '~> 4.8'
# Scheduled Job
gem 'whenever'
# Active Job
gem 'sidekiq'
gem 'connection_pool'
gem 'redis-namespace'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
First of all I haven't written any angular related code within the project.
i've tried
I deleted the error code and tried again, but the same problem occurs with other erb code.
I thought maybe it could be a version of the gem files. After deleting all gems, I reinstalled ruby (using rbenv), but I got the same error.
I have installed angular#1.8.0, but I got the same error.
Please let me know solution about couldn't find file 'angular/1.8.0/angular' with type 'application/javascript'
I found problem that since multiple projects are running on one server, all the projects have to be loaded locally. In the process, there was a conflict with the apidoco gem.
Solution is to remove apidoco from the Gemfile of the problem project.
Related
Suddenly got this error when starting my rails server
bundle exec rails s
Here is the error message
1: from /Users/michelleroos/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require'
/Users/michelleroos/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- faraday/request/multipart (LoadError)
I'm not sure if it is something to do with my gem file. I Googled the error and tried the solutions proposed in other SO threads but nothing worked.
What I tried already:
Basically everything in this thread
This thread
And this thread
Here is my gem file
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.3'
gem 'google-apis-sheets_v4'
gem 'google_drive'
gem 'dotenv-rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2' #5.2.3
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
# gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1', require: false #1.1.0
gem 'jquery-rails'
gem 'serialize_json-rails'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'better_errors'
gem 'binding_of_caller'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'annotate'
gem 'pry-rails'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
gem 'faker'
gem 'guard-rspec'
gem 'launchy'
gem 'shoulda-matchers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
In my case I got this error after fixing an initial error regarding the Spring gem and then after fixing an error regarding Multipart post. After lot of trial and error I decided to undo all the fixes by doing a git reset --hard and then removing the spring and spring-watcher-listen gems from the Gemfile and then uninstalling these 2 gems via the bundle exec gem uninstall gemname command.
I then discovered a new error when trying to run rails s which was about MySQL. Finally after fixing those errors I was able to do a successful rails s. I then added back the 2 gems, ran bundle and had no errors afterwards.
I'm trying to run command " rake db:test:prepare" in 6.2 of Rails Tutorial book. And then I had this problem
I have already run " gem install bundler". But it wasn't work. After I check version in path /home/myname/.rvm/gems. T got version of Ruby is 2.6.3
Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
gem 'annotate', '~> 2.7', '>= 2.7.5'
gem 'rspec-rails', '~> 3.8', '>= 3.8.2'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# group :production do
# gem 'pg', '0.17.1'
# gem 'rails_12factor', '0.0.2'
# end
How can i fix this problem? Thank you.
This usually comes up when the specified ruby version is not installed. To install using rvm run:
rvm install ruby-2.6.3
If you suspect it's already installed, then you may need to tell rvm to use the specific version, as it might default to another version (in this case 2.5.1). To do that run:
rvm --default use ruby-2.6.3
If it's not installed, the above command will throw a relevant error.
So, I am launching my app with Elasticbeanstalk and I am using Ruby on Rails for my app. However, when I ran the command "eb deploy {name}", it showed me the error
Creating application version archive "app-4f49-180904_151051".
Uploading: [##################################################] 100%
Done...
2018-09-04 07:12:09 INFO Environment update is starting.
2018-09-04 07:12:15 INFO Deploying new version to instance(s).
2018-09-04 07:12:47 ERROR [Instance: i-0ae9e24acc3308f6d] Command
failed on instance. Return code: 1 Output:
(TRUNCATED)...c65750cc.js.gz
rake aborted!
Autoprefixer doesn’t support Node v4.6.0. Update it.
/opt/rubies/ruby-2.5.1/bin/bundle:23:in `load'
/opt/rubies/ruby-2.5.1/bin/bundle:23:in `<main>'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace).
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
failed. For more detail, check /var/log/eb-activity.log using console
or EB CLI.
2018-09-04 07:12:47 INFO Command execution completed on all
instances. Summary: [Successful: 0, Failed: 1].
2018-09-04 07:12:47 ERROR Unsuccessful command execution on
instance id(s) 'i-0ae9e24acc3308f6d'. Aborting the operation.
2018-09-04 07:12:48 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.
However, I have check my gemfile, and did not see Autoprefix of any kind. I hope I am providing enough info, if not, please guide me in providing more details and finding an answer for this. Thank you in advance.
My gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4', '< 0.6.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'mini_racer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use ActiveStorage variant
# gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15', '< 4.0'
gem 'selenium-webdriver'
# Easy installation and use of chromedriver to run system tests with Chrome
gem 'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise'
gem 'figaro'
gem 'omniauth-google-oauth2'
gem 'twitter'
gem 'omniauth-twitter'
gem 'carrierwave', '~> 1.0'
gem "mini_magick"
gem 'omniauth-facebook'
gem "recaptcha", require: "recaptcha/rails"
gem 'impressionist'
gem 'social-share-button'
gem 'fog-aws'
# include bootstrap
gem 'bootstrap', '~> 4.1.0'
#include fontawesome
gem 'font-awesome-rails'
#include jquery & jquery ujs
gem 'jquery-rails'
gem 'acts-as-taggable-on', '~> 6.0'
gem 'will_paginate', '~> 3.1.0'
gem 'autosize'
gem 'jquery-ui-rails'
gem 'select2-rails'
Same issue–fixed it by uncommenting mini-racer worked for me, like #KedarnagMukanahallipatna suggested above.
Change From
# Gemfile
# gem 'mini_racer', platforms: :ruby
Change To
# Gemfile
gem 'mini_racer', platforms: :ruby
so for all this while i have been deploying my web app without knowing its on production or not.
I would usually create my project as usual , where i just do the basic bundle install. and add new gems. Setup unicorn + nginx .
And then when i view the aws's public dns, it would show me my site as i would get on localhost:3000.
In my mind, i am still in development environment. However, it seems that when i installed a new gem , it only works on localhost:3000 but on the deployed site it self it is unrecognized. Example would be an ActiveAdmin gem , where on my site it shows "uninitialized constant ActiveAdmin" .
How should i solve this ? I am suspecting it could be because of different environments, but i am unsure how to approach this.
UPDATE my gem file
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
#gem 'pdf-reader'
gem 'pdf-reader-turtletext'
gem 'nokogiri'
gem 'whenever', :require => false
gem 'unicorn'
gem 'devise'
#gem 'rails_admin', '~> 1.1.1'
gem 'activeadmin', github: 'activeadmin'
gem 'inherited_resources', github: 'activeadmin/inherited_resources'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I am using the gem of devise and I am getting error LoadError in Devise::RegistrationsController#create cannot load such file -- bcrypt_ext.. I tried to do some research regarding to this problem and also tried to follow the instruction given(https://stackoverflow.com/questions/35422463/loaderror-in-deviseregistrationscontrollercreate-cannot-load-such-file-bc)
But still having this problem. Any suggestion?
NOTE: The guide that I am using is video guide and I am using ruby on rails on windows 7
Gem File
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# error in devise
gem 'bcrypt-ruby', '~> 3.1', '>= 3.1.5'
# Bundle for authentication
gem 'devise', '~> 4.2', '>= 4.2.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0.rc1'
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.18'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', github: "rails/sass-rails"
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '~> 2.13.0'
gem 'selenium-webdriver'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
I was also having the same error, and my problem got fixed, please try solution 3
The problem is the compiled windows gem. It would be better if it were deleted and only include the pure ruby version.
Solution one:
You can copy bcrypt_ext.so from \lib\2.1 to \lib the same folder where is bcrypt.rb
Solution two:
You can use the gem install bcrypt --platform=ruby even if I had trouble to select that from rails which it always use the compiled version
Solution three:
git clone https://github.com/codahale/bcrypt-ruby.git
cd bcrypt-ruby
gem build bcrypt.gemspec
gem install gem-compiler
gem compile bcrypt-3.1.10.gem
gem install bcrypt-3.1.10-x64-mingw32.gem --local
Please do one thing and it will solve your problem
remove the version and rest just write this in your Gemfile
gem 'bcrypt-ruby'