Я часто получаю сообщение об ошибке. Например, при запуске сервера SQLite3:
$ rails s
C:/Ruby26-x64/bin/rails:23:in `load': cannot load such file -- C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.2.2/exe/rails (LoadError)
from C:/Ruby26-x64/bin/rails:23:in `<main>'
я перепробовал все различные предложения, которые я нашел здесь, например bundle install rails
. Я использую Ruby v. 2.6.5, но в приведенной выше ошибке упоминается 2.6.0.
$ which -a ruby
/c/Ruby26-x64/bin/ruby
/c/RailsInstaller/Ruby2.3.3/bin/ruby
Ruby версия:
$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]
файл gem:
`source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.5'
gem 'devise', '~> 4.2'
gem 'simple_form'
gem 'will_paginate'
gem 'news-api'
gem 'httparty'
gem 'executables'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# 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.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use Active Storage variant
gem 'image_processing', '~> 1.2'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', 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'
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 web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
bin/rails s
команда:
$ bin/rails s
bin/rails:4:in `require': cannot load such file -- rails/commands (LoadError)
from bin/rails:4:in `<main>'
команда gem env
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.0.3
- RUBY VERSION: 2.6.5 (2019-10-01 patchlevel 114) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby26-x64/lib/ruby/gems/2.6.0
- USER INSTALLATION DIRECTORY: C:/Users/darre/.gem/ruby/2.6.0
- RUBY EXECUTABLE: C:/Ruby26-x64/bin/ruby.exe
- GIT EXECUTABLE: C:\Program Files\Git\mingw64\bin/git.EXE
- EXECUTABLE DIRECTORY: C:/Ruby26-x64/bin
- SPEC CACHE DIRECTORY: C:/Users/darre/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby26-x64/lib/ruby/gems/2.6.0
- C:/Users/darre/.gem/ruby/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\Users\darre\.rbenv\bin
- C:\Users\darre\bin
- C:\Program Files\Git\mingw64\bin
- C:\Program Files\Git\usr\local\bin
- C:\Program Files\Git\usr\bin
- C:\Program Files\Git\usr\bin
- C:\Program Files\Git\mingw64\bin
- C:\Program Files\Git\usr\bin
- C:\Users\darre\bin
- C:\Program Files\ImageMagick-7.0.10-Q16
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0
- C:\Windows\System32\OpenSSH
- C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
- C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
- C:\Program Files\Intel\WiFi\bin
- C:\Program Files\Common Files\Intel\WirelessCommon
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0
- C:\WINDOWS\System32\OpenSSH
- C:\Program Files\Git\cmd
- C:\Users\darre\AppData\Local\Microsoft\WindowsApps
- C:\Users\darre\AppData\Local\atom\bin
- C:\Program Files\Java\jdk1.8.0_111\bin
- C:\Python27
- C:\adb
- C:\Program Files\nodejs
- C:\Program Files (x86)\Yarn\bin
- C:\Users\darre\scoop\apps\yarn\current\Yarn\bin
- C:\Users\darre\scoop\persist\yarn\global\node_modules\.bin
- C:\Users\darre\scoop\shims
- C:\Ruby26-x64\bin
- C:\RailsInstaller\Git\cmd
- C:\RailsInstaller\Ruby2.3.3\bin
- C:\Users\darre\AppData\Local\Microsoft\WindowsApps
- C:\Users\darre\AppData\Local\atom\bin
- C:\Program Files\Java\jdk1.8.0_111\bin
- C:\Python27
- C:\Users\darre\AppData\Local\Programs\Microsoft VS Code\bin
- C:\Users\darre\AppData\Roaming\npm
- C:\Users\darre\AppData\Local\Yarn\bin
- C:\Program Files\heroku\bin
- C:\Program Files\Git\usr\bin\vendor_perl
- C:\Program Files\Git\usr\bin\core_perl