【发布时间】:2018-01-19 17:36:23
【问题描述】:
我正在使用Passenger 部署我的Rails 应用程序,当我运行此命令以准备好我的应用程序并设置为生产时,我收到了这条纱线消息,但没有运行进一步的操作。
bundle exec rake assets:precompile db:migrate RAILS_ENV=production
该命令的输出:
yarn install v1.3.2
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Lockfile not saved, no dependencies.
Done in 0.04s.
运行完成后,我跳到 Rails 控制台并运行Rails.env,结果就是开发。我已经删除并重新安装了 Yarn,但这并不走运。没有 Yarn 依赖项,所以我很困惑为什么我首先需要它。如果我在没有安装 Yarn 的情况下运行 bundle exec 命令,我会收到以下消息:
Yarn executable was not detected in the system.
Download Yarn at https://yarnpkg.com/en/docs/install
有人知道如何在不安装 Yarn 的情况下绕过它或将其设置为生产模式吗?
我也试过跑步:
RAILS_ENV=production rake assets:precompile
但是得到这个相当大的输入:
/var/www/isharelessons/code/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/file_utils.rb:10: warning: already initialized constant FileUtils::RUBY
/var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/file_utils.rb:10: warning: previous definition of RUBY was here
/var/www/isharelessons/code/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/file_utils.rb:109: warning: already initialized constant FileUtils::LN_SUPPORTED
/var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/file_utils.rb:109: warning: previous definition of LN_SUPPORTED was here
/var/www/isharelessons/code/vendor/bundle/ruby/2.3.0/gems/rake-12.3.0/lib/rake/file_utils_ext.rb:17: warning: already initialized constant Rake::FileUtilsExt::DEFAULT
/var/lib/gems/2.3.0/gems/rake-12.3.0/lib/rake/file_utils_ext.rb:17: warning: previous definition of DEFAULT was here
WARNING: Possible conflict with Rake extension: String#ext already exists
WARNING: Possible conflict with Rake extension: String#pathmap already exists
[....]
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-5 passenger yarnpkg