#発生している問題
Ruby on Rails5でacts-as-taggable-onを使用するためGemfileに
Ruby
1gem 'acts-as-taggable-on', github: 'mbleigh/acts-as-taggable-on', branch: 'master'
を追加し、bundle installする。その後
rake acts_as_taggable_on_engine:install:migrations
を行うところまでは正常に動作します。しかしその次に
rails db:migrate
を行うと
LoadError: 126: 指定されたモジュールが見つかりません。 - C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rmagick-2.16.0/lib/RMagick2.so D:/Collection/config/application.rb:7:in `<top (required)>' D:/Collection/Rakefile:4:in `require_relative' D:/Collection/Rakefile:4:in `<top (required)>' bin/rails:4:in `require' bin/rails:4:in `<main>' (See full trace by running task with --trace)
と出てしまい、マイグレーションができません。gemの中にある
Ruby
1gem 'rmagick', :require => 'RMagick'
を削除すると正しく動くのですがRMagickも使用しているため削除はしたくありません。
Rubyのバージョンをアップデートした際の rmagick-2.15.2/RMagick2.so (LoadError)
の方法も試してみたのですがダメでした。
どうすればこの2つを併用し、エラーなしでmigrateできるのでしょうか。
#環境
Windows 10 Pro version1709
Ruby 2.4.3p205 (2017-12-14 revision 61247) [x64-mingw32]
Rails 5.1.4
#Gemfile
Ruby
1source 'https://rubygems.org' 2 3git_source(:github) do |repo_name| 4 repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 5 "https://github.com/#{repo_name}.git" 6end 7 8 9# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 10gem 'rails', '~> 5.1.4' 11# Use sqlite3 as the database for Active Record 12gem 'sqlite3' 13# Use Puma as the app server 14gem 'puma', '~> 3.7' 15# Use SCSS for stylesheets 16gem 'sass-rails', '~> 5.0' 17# Use Uglifier as compressor for JavaScript assets 18gem 'uglifier', '>= 1.3.0' 19# See https://github.com/rails/execjs#readme for more supported runtimes 20# gem 'therubyracer', platforms: :ruby 21 22# Use CoffeeScript for .coffee assets and views 23gem 'coffee-rails', '~> 4.2' 24# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 25gem 'turbolinks', '~> 5' 26# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 27gem 'jbuilder', '~> 2.5' 28# Use Redis adapter to run Action Cable in production 29# gem 'redis', '~> 3.0' 30# Use ActiveModel has_secure_password 31# gem 'bcrypt', '~> 3.1.7' 32 33# Use Capistrano for deployment 34# gem 'capistrano-rails', group: :development 35 36group :development, :test do 37 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 38 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 39 # Adds support for Capybara system testing and selenium driver 40 gem 'capybara', '~> 2.13' 41 gem 'selenium-webdriver' 42end 43 44group :development do 45 # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 46 gem 'web-console', '>= 3.3.0' 47end 48 49# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 50gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 51 52#ユーザー認証用 53gem 'devise' 54gem 'omniauth' 55gem 'omniauth-twitter' 56 57#画像アップロード 58gem 'carrierwave' 59gem 'mini_magick' 60gem 'rmagick', :require => 'RMagick' 61 62gem 'acts-as-taggable-on', github: 'mbleigh/acts-as-taggable-on', branch: 'master'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/29 08:37
2018/01/29 12:58