我在使用Ruby on Rail的本地系统上设置和运行docker实例时遇到问题。请查看我的docker配置文件:-
Docker文件
FROM ruby:2.3.1
RUN useradd -ms /bin/bash web
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get -y install nginx
RUN apt-get -y install sudo
# for postgres
RUN apt-get install -y libpq-dev
# for nokogiri
RUN apt-get install -y libxml2-dev libxslt1-dev
# for a JS runtime
RUN apt-get install -y nodejs
RUN apt-get update
# For docker cache
WORKDIR /tmp
ADD ./Gemfile Gemfile
ADD ./Gemfile.lock Gemfile.lock
ENV BUNDLE_PATH /bundle
RUN gem install bundler --no-rdoc …Run Code Online (Sandbox Code Playgroud) ruby-on-rails amazon-ec2 docker ruby-on-rails-5 docker-compose
我越来越
BuyTagsController中的NoMethodError #index未定义方法`unpack'代表nil:NilClass
提取的来源(buy_tags_controller.rb第18行):
eco_producer.nreduction = eco_value['nreduction']
str = eco_value['image']
eco_producer.image = Base64.decode64(str)
eco_producer.save
end
Run Code Online (Sandbox Code Playgroud)
应用跟踪:
.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/base64.rb:58:in `decode64'
app/controllers/buy_tags_controller.rb:18:in `block in index'
app/controllers/buy_tags_controller.rb:13:in `each'
app/controllers/buy_tags_controller.rb:13:in `index'
actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'
actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
Run Code Online (Sandbox Code Playgroud)