嗨,我有一个rails 5 app ubuntu 16.04 puma这里是从puma.stderr.log输出
/home/ashish/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activerecord-5.1.4/lib/active_record/connection_adapters/connection_specification.rb:188:in `rescue in spec': Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)
虽然这是bundle show命令的结果
* actioncable (5.1.4)
* actionmailer (5.1.4)
* actionpack (5.1.4)
* actionview (5.1.4)
* activejob (5.1.4)
* activemerchant (1.73.0)
* activemodel (5.1.4)
* activerecord (5.1.4)
* activesupport (5.1.4)
* acts-as-taggable-on (5.0.0)
* acts_as_list (0.9.9)
* addressable (2.5.2)
* arel (8.0.0)
* autoprefixer-rails (7.1.6)
* awesome_nested_set (3.1.3)
* bcrypt (3.1.11)
* bindex (0.5.0)
* bootstrap-sass (3.3.7)
* builder (3.2.3)
* bundler (1.16.0)
* byebug (9.1.0)
* camertron-eprun (1.1.1)
* cancancan (2.0.0)
* canonical-rails (0.2.1)
* capybara (2.15.4)
* carmen (1.0.2)
* childprocess (0.8.0)
* cldr-plurals-runtime-rb (1.0.1)
* climate_control (0.2.0)
* cocaine (0.5.8)
* coffee-rails (4.2.2)
* coffee-script (2.4.1)
* coffee-script-source (1.12.2)
* concurrent-ruby (1.0.5)
* crass (1.0.2)
* css_parser (1.6.0)
* deface (1.2.0)
* devise (4.3.0)
* devise-encryptable (0.2.0)
* erubi (1.7.0)
* execjs (2.7.0)
* ffaker (2.7.0)
* ffi (1.9.18)
* friendly_id (5.2.3)
* globalid (0.4.0)
* highline (1.6.21)
* htmlentities (4.3.4)
* i18n (0.8.6)
* jbuilder (2.7.0)
* jquery-rails (4.3.1)
* jquery-ui-rails (6.0.1)
* kaminari (1.0.1)
* kaminari-actionview (1.0.1)
* kaminari-activerecord (1.0.1)
* kaminari-core (1.0.1)
* loofah (2.1.1)
* mail (2.6.6)
* method_source (0.9.0)
* mime-types (3.1)
* mime-types-data (3.2016.0521)
* mimemagic (0.3.2)
* mini_mime (0.1.4)
* mini_portile2 (2.3.0)
* minitest (5.10.3)
* monetize (1.7.0)
* money (6.9.0)
* multi_json (1.12.2)
* mysql2 (0.4.9)
* nio4r (2.1.0)
* nokogiri (1.8.1)
* orm_adapter (0.5.0)
* paperclip (5.1.0)
* paranoia (2.3.1)
* polyamorous (1.3.1)
* polyglot (0.3.5)
* premailer (1.11.0)
* premailer-rails (1.9.7)
* public_suffix (3.0.0)
* puma (3.10.0)
* rabl (0.13.1)
* rack (2.0.3)
* rack-test (0.7.0)
* rails (5.1.4)
* rails-dom-testing (2.0.3)
* rails-html-sanitizer (1.0.3)
* railties (5.1.4)
* rainbow (2.2.2)
* rake (12.1.0)
* ransack (1.8.4)
* rb-fsevent (0.10.2)
* rb-inotify (0.9.10)
* responders (2.4.0)
* rubyzip (1.2.1)
* sass (3.5.2)
* sass-listen (4.0.0)
* sass-rails (5.0.6)
* select2-rails (3.5.9.1)
* selenium-webdriver (3.6.0)
* spree (3.3.1)
* spree_api (3.3.1)
* spree_auth_devise (3.3.1)
* spree_backend (3.3.1)
* spree_cmd (3.3.1)
* spree_core (3.3.1)
* spree_extension (0.0.5)
* spree_frontend (3.3.1)
* spree_frontend_medical_shop (0.0.1.alpha)
* spree_gateway (3.3.0)
* spree_product_brands (0.0.1.alpha)
* spree_related_products (3.3.0)
* spree_sample (3.3.1)
* spree_scaffold (3.0.0)
* spree_slider (3.1.0)
* sprockets (3.7.1)
* sprockets-rails (3.2.1)
* state_machines (0.5.0)
* state_machines-activemodel (0.5.0)
* state_machines-activerecord (0.5.0)
* stringex (2.7.1)
* thor (0.20.0)
* thread_safe (0.3.6)
* tilt (2.0.8)
* turbolinks (5.0.1)
* turbolinks-source (5.0.3)
* twitter_cldr (4.4.2)
* tzinfo (1.2.3)
* uglifier (3.2.0)
* versioncake (3.3.0)
* warden (1.2.7)
* web-console (3.5.1)
* websocket-driver (0.6.5)
* websocket-extensions (0.1.2)
* xpath (2.1.0)
我的.bundle / config文件
BUNDLE_FROZEN: "true"
BUNDLE_PATH: "vendor/bundle"
BUNDLE_DISABLE_SHARED_GEMS: '1'
您可以轻松地看到所有必需的宝石都已安装。请告诉我为什么它不使用来自vendor / bundle的bundle
Env ubuntu 16.04 puma 3 rail 5 ruby 2.33使用rbenv
这是gemfile
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.3'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
# 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
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'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'spree', '3.3.1'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'
gem 'spree_slider', path: 'vendor/gems/spree_slider'
gem 'spree_related_products', path: 'vendor/gems/spree_related_products'
gem 'spree_frontend_medical_shop', path: 'vendor/gems/spree_frontend_medical_shop'
gem 'spree_product_brands', path: 'vendor/gems/spree_product_brands'
#gem 'spree_wallet', path: 'vendor/gems/spree_wallet'
#gem 'sprockets-helpers', '~> 1.2.1'
#gem 'vinsol_spree_themes', path: 'E:\Websites\Developing\MedBharat\spree_themes'
group :development do
gem 'spree_scaffold', path: 'vendor/gems/spree_scaffold'
end
有些是当地的宝石
实际上问题是我在Windows上开发它并部署到ubuntu。所以没有安装原生宝石。当我在gemfile中添加所需的平台并运行bundle install时,应用程序运行正常