Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

Ruby on Rail コントローラー作成について

質問させていただきます。
初学者でして、お聞き苦しいところございましたら申し訳ありません。
Ruby on Railsにてコントローラーを作成しようと、
vocstartsoft:~/environment/sample_app (master) $ rails g controller homes
と入力するのですが、下記エラーコードが出て実行ができません。
今日一日色々と調べて試してみたのですが、全く変化がなくうまくいかず、どなたかご助力いただけますと恐縮です。
よろしくお願いいたします。

/home/ec2-user/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/lib/ffi.rb:6:in require': libffi.so.7: cannot open shared object file: No such file or directory - /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/lib/ffi_c.so (LoadError)
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/lib/ffi.rb:6:in
rescue in '
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/lib/ffi.rb:3:in <top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rb-inotify-0.10.1/lib/rb-inotify/native.rb:1:in
require'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rb-inotify-0.10.1/lib/rb-inotify/native.rb:1:in <top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rb-inotify-0.10.1/lib/rb-inotify.rb:2:in
require'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/rb-inotify-0.10.1/lib/rb-inotify.rb:2:in <top (required)>'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in
require'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/linux.rb:30:in _configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/base.rb:45:in
block in configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in each'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/base.rb:40:in
configure'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/adapter/base.rb:63:in start'
from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/forwardable.rb:230:in
start'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/listener.rb:68:in block in <class:Listener>'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/fsm.rb:121:in
instance_eval'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/fsm.rb:121:in call'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/fsm.rb:91:in
transition_with_callbacks!'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/fsm.rb:57:in transition'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/listen-3.1.5/lib/listen/listener.rb:91:in
start'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-watcher-listen-2.0.1/lib/spring/watcher/listen.rb:27:in start'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:80:in
start_watcher'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:89:in preload'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:157:in
serve'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:145:in block in run'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:139:in
loop'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application.rb:139:in run'
from /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib/spring/application/boot.rb:19:in
'
from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
from /home/ec2-user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in
require'
from -e:1:in `'

0 likes

1Answer

railsコマンドを実行する上でのgemがインストールできていないような気がします。
bundle installを実行した後もう一度実行するとどうなるでしょうか?

0Like

Your answer might help someone💌