vagrant環境にて、表題の通り、rails gコマンドが通りません。
また、作成中のアプリ名はfinal-cdeeenという名前です。
エラーメッセージは以下の通りです。
vagrant@ubuntu-bionic:/vagrant/final-cdeeen$ rails g model Sample /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/ffi-1.11.3/lib/ffi.rb:6:in `require': incompatible library version - /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/ffi-1.11.3/lib/ffi_c.so (LoadError) from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/ffi-1.11.3/lib/ffi.rb:6:in `rescue in <top (required)>' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/ffi-1.11.3/lib/ffi.rb:3:in `<top (required)>' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/rb-inotify-0.10.0/lib/rb-inotify/native.rb:1:in `require' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/rb-inotify-0.10.0/lib/rb-inotify/native.rb:1:in `<top (required)>' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/rb-inotify-0.10.0/lib/rb-inotify.rb:2:in `require' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/rb-inotify-0.10.0/lib/rb-inotify.rb:2:in `<top (required)>' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in `require' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in `_configure' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/base.rb:45:in `block in configure' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in `each' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in `configure' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/adapter/base.rb:63:in `start' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/listener.rb:68:in `block in <class:Listener>' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/fsm.rb:121:in `instance_eval' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/fsm.rb:121:in `call' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/fsm.rb:91:in `transition_with_callbacks!' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/fsm.rb:57:in `transition' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/listen-3.1.5/lib/listen/listener.rb:91:in `start' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-watcher-listen-2.0.1/lib/spring/watcher/listen.rb:27:in `start' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:80:in `start_watcher' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:89:in `preload' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:157:in `serve' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application.rb:139:in `run' from /vagrant/final-cdeeen/vendor/cache/ruby/2.5.0/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>' from /home/vagrant/.rbenv/versions/2.5.7/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from /home/vagrant/.rbenv/versions/2.5.7/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' from -e:1:in `<main>'
使っている、バージョンは以下の通りです。
vagrant@ubuntu-bionic:/vagrant/final-cdeeen$ rails -v Rails 5.2.4 vagrant@ubuntu-bionic:/vagrant/final-cdeeen$ ruby -v ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-linux] vagrant@ubuntu-bionic:/vagrant/final-cdeeen$ bundler -v Bundler version 2.0.2
試したこと
rubyのバージョンをrbenvで2.6から、2.5.3に変更しました。 ffiというgemが入っていないのではと思い、 $ gem install ffi -v 1.0.9 をし、ffiをインストールしましたが、ダメでした。
補足
初心者なので分からないことが多いですがよろしくお願いします。
回答1件
あなたの回答
tips
プレビュー