简体   繁体   中英

Error running rails app on docker container of official Ruby image

I pulled official Ruby image from docker hub. Since the official Rails image has been deprecated, I felt like using using my rails development inside a Ruby container. Inside the Ruby container, I did gem install rails --version=5.1.1 . I created a rails app and when I do rails s , it throws the following error. What is the problem? Do i need to install additional dependencies? Is this is a nodejs related issue, which I think is not pre- installed in the Ruby image?

bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
:
:
from /home/blog/config/application.rb:7:in `<top (required)>'
:
:
from /usr/local/bundle/gems/railties-5.1.1/lib/rails/command.rb:44:in `invoke'
from /usr/local/bundle/gems/railties-5.1.1/lib/rails/commands.rb:16:in `<top (required)>'
from /home/blog/bin/rails:9:in `require'
from /home/blog/bin/rails:9:in `<top (required)>'
from /usr/local/bundle/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
:
:
from /home/blog/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

Sorry I can't comment, not enough points, but I can answer.

The gem installs and setup usually happen prior and during the setup of the container. Not afterwards manually like you are attempting to do.

Can you post up your Dockerfile so we can have a look?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM