- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试像下面这样运行 docker。但即使我安装了 yarn 它仍然不起作用。运行 Rails 时出错:未安装 yarn
。
Dockerfile
:
FROM rails:on-build
EXPOSE 3000
CMD [ "rails" , "s" , "-b" , "0.0.0.0" , "-p", "3000" ]
rails/Dockerfile
:
FROM ruby:2.6.2
RUN apt-get update -y && apt-get install -y build-essential libpq-dev nodejs sqlite3
ONBUILD COPY app /opt/app
ONBUILD WORKDIR /opt/app
ONBUILD EXPOSE 3000
ONBUILD RUN bundle install
ONBUILD RUN rake db:migrate
ONBUILD RUN rake db:seed
run.sh
:
docker-machine create -d virtualbox Char
eval $(docker-machine env Char)
docker build -t rails:on-build . #this runs ok
docker build -t "thisdir:Dockerfile" . #this command triggers the error
错误:
Sending build context to Docker daemon 3.584kB
Step 1/4 : FROM rails:on-build
# Executing 6 build triggers
---> Using cache
---> Running in 7bfd996846cd
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create Gemfile
run git init from "."
Initialized empty Git repository in /opt/app/.git/
create package.json
create app
create app/assets/config/manifest.js
create app/assets/stylesheets/application.css
create app/channels/application_cable/channel.rb
create app/channels/application_cable/connection.rb
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/javascript/channels/consumer.js
create app/javascript/channels/index.js
create app/javascript/packs/application.js
create app/jobs/application_job.rb
create app/mailers/application_mailer.rb
create app/models/application_record.rb
create app/views/layouts/application.html.erb
create app/views/layouts/mailer.html.erb
create app/views/layouts/mailer.text.erb
create app/assets/images/.keep
create app/controllers/concerns/.keep
create app/models/concerns/.keep
create bin
create bin/rails
create bin/rake
create bin/setup
create bin/yarn
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/cable.yml
create config/puma.rb
create config/spring.rb
create config/storage.yml
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/application_controller_renderer.rb
create config/initializers/assets.rb
create config/initializers/backtrace_silencers.rb
create config/initializers/content_security_policy.rb
create config/initializers/cookies_serializer.rb
create config/initializers/cors.rb
create config/initializers/filter_parameter_logging.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/new_framework_defaults_6_0.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/master.key
append .gitignore
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create lib
create lib/tasks
create lib/tasks/.keep
create lib/assets
create lib/assets/.keep
create log
create log/.keep
create public
create public/404.html
create public/422.html
create public/500.html
create public/apple-touch-icon-precomposed.png
create public/apple-touch-icon.png
create public/favicon.ico
create public/robots.txt
create tmp
create tmp/.keep
create tmp/pids
create tmp/pids/.keep
create tmp/cache
create tmp/cache/assets
create vendor
create vendor/.keep
create test/fixtures
create test/fixtures/.keep
create test/fixtures/files
create test/fixtures/files/.keep
create test/controllers
create test/controllers/.keep
create test/mailers
create test/mailers/.keep
create test/models
create test/models/.keep
create test/helpers
create test/helpers/.keep
create test/integration
create test/integration/.keep
create test/channels/application_cable/connection_test.rb
create test/test_helper.rb
create test/system
create test/system/.keep
create test/application_system_test_case.rb
create storage
create storage/.keep
create tmp/storage
create tmp/storage/.keep
remove config/initializers/cors.rb
remove config/initializers/new_framework_defaults_6_0.rb
run bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching rake 13.0.1
Installing rake 13.0.1
Fetching concurrent-ruby 1.1.5
Installing concurrent-ruby 1.1.5
Fetching i18n 1.7.0
Installing i18n 1.7.0
Fetching minitest 5.13.0
Installing minitest 5.13.0
Fetching thread_safe 0.3.6
Installing thread_safe 0.3.6
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching zeitwerk 2.2.2
Installing zeitwerk 2.2.2
Fetching activesupport 6.0.2.1
Installing activesupport 6.0.2.1
Fetching builder 3.2.4
Installing builder 3.2.4
Fetching erubi 1.9.0
Installing erubi 1.9.0
Fetching mini_portile2 2.4.0
Installing mini_portile2 2.4.0
Fetching nokogiri 1.10.7
Installing nokogiri 1.10.7 with native extensions
Fetching rails-dom-testing 2.0.3
Installing rails-dom-testing 2.0.3
Fetching crass 1.0.5
Installing crass 1.0.5
Fetching loofah 2.4.0
Installing loofah 2.4.0
Fetching rails-html-sanitizer 1.3.0
Installing rails-html-sanitizer 1.3.0
Fetching actionview 6.0.2.1
Installing actionview 6.0.2.1
Fetching rack 2.0.8
Installing rack 2.0.8
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching actionpack 6.0.2.1
Installing actionpack 6.0.2.1
Fetching nio4r 2.5.2
Installing nio4r 2.5.2 with native extensions
Fetching websocket-extensions 0.1.4
Installing websocket-extensions 0.1.4
Fetching websocket-driver 0.7.1
Installing websocket-driver 0.7.1 with native extensions
Fetching actioncable 6.0.2.1
Installing actioncable 6.0.2.1
Fetching globalid 0.4.2
Installing globalid 0.4.2
Fetching activejob 6.0.2.1
Installing activejob 6.0.2.1
Fetching activemodel 6.0.2.1
Installing activemodel 6.0.2.1
Fetching activerecord 6.0.2.1
Installing activerecord 6.0.2.1
Fetching mimemagic 0.3.3
Installing mimemagic 0.3.3
Fetching marcel 0.3.3
Installing marcel 0.3.3
Fetching activestorage 6.0.2.1
Installing activestorage 6.0.2.1
Fetching mini_mime 1.0.2
Installing mini_mime 1.0.2
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching actionmailbox 6.0.2.1
Installing actionmailbox 6.0.2.1
Fetching actionmailer 6.0.2.1
Installing actionmailer 6.0.2.1
Fetching actiontext 6.0.2.1
Installing actiontext 6.0.2.1
Fetching public_suffix 4.0.1
Installing public_suffix 4.0.1
Fetching addressable 2.7.0
Installing addressable 2.7.0
Fetching bindex 0.8.1
Installing bindex 0.8.1 with native extensions
Fetching msgpack 1.3.1
Installing msgpack 1.3.1 with native extensions
Fetching bootsnap 1.4.5
Installing bootsnap 1.4.5 with native extensions
Using bundler 2.1.1
Fetching byebug 11.0.1
Installing byebug 11.0.1 with native extensions
Fetching regexp_parser 1.6.0
Installing regexp_parser 1.6.0
Fetching xpath 3.2.0
Installing xpath 3.2.0
Fetching capybara 3.29.0
Installing capybara 3.29.0
Fetching childprocess 3.0.0
Installing childprocess 3.0.0
Fetching ffi 1.11.3
Installing ffi 1.11.3 with native extensions
Fetching jbuilder 2.9.1
Installing jbuilder 2.9.1
Fetching rb-fsevent 0.10.3
Installing rb-fsevent 0.10.3
Fetching rb-inotify 0.10.0
Installing rb-inotify 0.10.0
Fetching ruby_dep 1.5.0
Installing ruby_dep 1.5.0
Fetching listen 3.1.5
Installing listen 3.1.5
Fetching method_source 0.9.2
Installing method_source 0.9.2
Fetching puma 4.3.1
Installing puma 4.3.1 with native extensions
Fetching rack-proxy 0.6.5
Installing rack-proxy 0.6.5
Fetching thor 1.0.1
Installing thor 1.0.1
Fetching railties 6.0.2.1
Installing railties 6.0.2.1
Fetching sprockets 4.0.0
Installing sprockets 4.0.0
Fetching sprockets-rails 3.2.1
Installing sprockets-rails 3.2.1
Fetching rails 6.0.2.1
Installing rails 6.0.2.1
Fetching rubyzip 2.0.0
Installing rubyzip 2.0.0
Fetching sassc 2.2.1
Installing sassc 2.2.1 with native extensions
Fetching tilt 2.0.10
Installing tilt 2.0.10
Fetching sassc-rails 2.1.2
Installing sassc-rails 2.1.2
Fetching sass-rails 6.0.0
Installing sass-rails 6.0.0
Fetching selenium-webdriver 3.142.6
Installing selenium-webdriver 3.142.6
Fetching spring 2.1.0
Installing spring 2.1.0
Fetching spring-watcher-listen 2.0.1
Installing spring-watcher-listen 2.0.1
Fetching sqlite3 1.4.2
Installing sqlite3 1.4.2 with native extensions
Fetching turbolinks-source 5.2.0
Installing turbolinks-source 5.2.0
Fetching turbolinks 5.2.1
Installing turbolinks 5.2.1
Fetching web-console 4.0.1
Installing web-console 4.0.1
Fetching webdrivers 4.1.3
Installing webdrivers 4.1.3
Fetching webpacker 4.2.2
Installing webpacker 4.2.2
Bundle complete! 17 Gemfile dependencies, 75 gems now installed.
Bundled gems are installed into `/usr/local/bundle`
run bundle binstubs bundler
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
run bundle exec spring binstub --all
/usr/local/lib/ruby/2.6.0/bundler/vendor/fileutils/lib/fileutils.rb:1186: warning: already initialized constant Bundler::FileUtils::Entry_::S_IF_DOOR
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/vendor/fileutils/lib/fileutils.rb:1284: warning: previous definition of S_IF_DOOR was here
/usr/local/lib/ruby/2.6.0/bundler/vendor/fileutils/lib/fileutils.rb:1444: warning: already initialized constant Bundler::FileUtils::Entry_::DIRECTORY_TERM
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/vendor/fileutils/lib/fileutils.rb:1568: warning: previous definition of DIRECTORY_TERM was here
/usr/local/lib/ruby/2.6.0/bundler/vendor/fileutils/lib/fileutils.rb:1499: warning: already initialized constant Bundler::FileUtils::OPT_TABLE
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/vendor/fileutils/lib/fileutils.rb:1626: warning: previous definition of OPT_TABLE was here
/usr/local/lib/ruby/2.6.0/bundler/vendor/fileutils/lib/fileutils.rb:1553: warning: already initialized constant Bundler::FileUtils::LOW_METHODS
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/vendor/fileutils/lib/fileutils.rb:1685: warning: previous definition of LOW_METHODS was here
/usr/local/lib/ruby/2.6.0/bundler/vendor/fileutils/lib/fileutils.rb:1560: warning: already initialized constant Bundler::FileUtils::METHODS
/usr/local/bundle/gems/bundler-2.1.1/lib/bundler/vendor/fileutils/lib/fileutils.rb:1692: warning: previous definition of METHODS was here
bundler: failed to load command: spring (/usr/local/bundle/ruby/2.6.0/bin/spring)
ArgumentError: Trying to register Bundler::GemfileError for status code 4 but Bundler::GemfileError is already registered
/usr/local/lib/ruby/2.6.0/bundler/errors.rb:9:in `status_code'
/usr/local/lib/ruby/2.6.0/bundler/errors.rb:20:in `<class:GemfileError>'
/usr/local/lib/ruby/2.6.0/bundler/errors.rb:20:in `<module:Bundler>'
/usr/local/lib/ruby/2.6.0/bundler/errors.rb:3:in `<top (required)>'
/usr/local/lib/ruby/2.6.0/bundler.rb:10:in `require'
/usr/local/lib/ruby/2.6.0/bundler.rb:10:in `<top (required)>'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/run.rb:3:in `require'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client/run.rb:3:in `<top (required)>'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:5:in `require'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/lib/spring/client.rb:5:in `<top (required)>'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/bin/spring:48:in `require'
/usr/local/bundle/ruby/2.6.0/gems/spring-2.1.0/bin/spring:48:in `<top (required)>'
/usr/local/bundle/ruby/2.6.0/bin/spring:23:in `load'
/usr/local/bundle/ruby/2.6.0/bin/spring:23:in `<top (required)>'
rails webpacker:install
Yarn not installed. Please download and install Yarn from https://yarnpkg.com/lang/en/docs/install/
The command '/bin/sh -c rails new app' returned a non-zero code: 1
我尝试通过将以下两行添加到两个 Dockerfile 的顶部来安装 yarn ,但它仍然无法工作,它有相同的错误。
FROM node:6.7.0
RUN npm install -g yarn
最佳答案
用这个更新你的docker文件,这将安装最新版本的nodejs和yarn
RUN curl https://deb.nodesource.com/setup_12.x | bash
RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y nodejs yarn
关于ruby-on-rails - Docker未安装yarn,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59402528/
以下是一个非常简单的ruby服务器。 require 'socket' local_socket = Socket.new(:INET, :STREAM) local_addr = Socket.
我正在使用 OS X(使用 bash),并且是 unix 的新手。我想知道是否可以修改一些文件以便运行 ruby 程序,我不需要“ruby file.rb”,而是可以运行“ruby.rb”。 有理
我在用 Ruby 替换字符串时遇到一些问题。 我的原文:人之所为不如兽之所为。 我想替换为:==What== human does is not like ==what== animal does.
我想在一个循环中从 Ruby 脚本做这样的事情: 写一个文件a.rb(每次迭代都会改变) 执行系统(ruby 'a.rb') a.rb 将带有结果的字符串写入文件“results” a.rb 完成并且
我的问题是尝试创建一个本地服务器,以便我可以理解由我的新团队开发的应用程序。我的问题是我使用的是 Ruby 2.3.3,而 Gemfile 需要 2.3.1。我无法编辑 Gemfile,因为我被告知很
我有一个使用 GLI 框架用 Ruby 编写的命令行实用程序。我想在我的主目录中配置我的命令行实用程序,使用 Ruby 本身作为 DSL 来处理它(类似于 Gemfile 或 Rakefile)。 我
我的 Rails 应用 Controller 中有这段代码: def delete object = model.datamapper_class.first(:sourced_id =>
我正在寻找的解析器应该: 对 Ruby 解析友好, 规则设计优雅, 产生用户友好的解析错误, 用户文档的数量应该比计算器示例多, UPD:允许在编写语法时省略可选的空格。 快速解析不是一个重要的特性。
我刚开始使用 Ruby,听说有一种“Ruby 方式”编码。除了 Ruby on Rails 之外,还有哪些项目适合学习并被认可且设计良好? 最佳答案 Prawn被明确地创建为不仅是一个该死的好 PDF
我知道之前有人问过类似的问题,但是我该如何构建一个无需在前面输入“ruby”就可以在终端中运行的 Ruby 文件呢? 这里的最终目标是创建一个命令行工具包类型的东西。现在,为了执行我希望用户能够执行的
例如哈希a是{:name=>'mike',:age=>27,:gender=>'male'}哈希 b 是 {:name=>'mike'} 我想知道是否有更好的方法来判断 b 哈希是否在 a 哈希内,而
我是一名决定学习 Ruby 和 Ruby on Rails 的 ASP.NET MVC 开发人员。我已经有所了解并在 RoR 上创建了一个网站。在 ASP.NET MVC 上开发,我一直使用三层架构:
最近我看到 Gary Bernhardt 展示了他用来在 vim 中执行 Ruby 代码的 vim 快捷方式。捷径是 :map ,t :w\|:!ruby %. 似乎这个方法总是执行系统 Rub
在为 this question about Blue Ruby 选择的答案中,查克说: All of the current Ruby implementations are compiled to
我有一个 Ruby 数组 > list = Request.find_all_by_artist("Metallica").map(&:song) => ["Nothing else Matters"
我在四舍五入时遇到问题。我有一个 float ,我想将其四舍五入到小数点后的百分之一。但是,我只能使用 .round ,它基本上将它变成一个 int,意思是 2.34.round # => 2. 有没
我使用 ruby on rails 编写了一个小型 Web 应用程序,它的主要目的是上传、存储和显示来自 xml(文件最多几 MB)文件的结果。运行大约 2 个月后,我注意到 mongrel 进程
我们如何用 Ruby 转换像这样的字符串: 𝑙𝑎𝑡𝑜𝑟𝑟𝑒 收件人: Latorre 最佳答案 s = "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" => "𝑙𝑎𝑡𝑜𝑟𝑟𝑒" s.u
通过 ruby monk 时,他们偶尔会从左侧字段中抛出一段语法不熟悉的代码: def compute(xyz) return nil unless xyz xyz.map {|a,
不确定我做错了什么,但我似乎弄错了。 问题是,给你一串空格分隔的数字,你必须返回最大和最小的数字。 注意:所有数字都是有效的 Int32,不需要验证它们。输入字符串中始终至少有一个数字。输出字符串必须
我是一名优秀的程序员,十分优秀!