我试图预编译资产(rake assets:precompile或bundle exec rake assets:precompile),但我总是得到错误
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Access denied for user 'root'@'localhost' (using password: YES)
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/Users/adam/.rvm/rubies/ruby-1.9.2-p290/b...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Run Code Online (Sandbox Code Playgroud)
有谁知道什么可能是错的?
编辑跟踪输出
rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/Users/adam/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /Users/adam/.rvm/gems/ruby-1.9.2-p290/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** …Run Code Online (Sandbox Code Playgroud) 昨晚我觉得我做了一些能够改变轨道开发环境的东西,而且我无法扭转我所做的事情.
我将更新迁移到生产中,并且在预编译样式表时遇到一些问题,因此我退出了更改并决定在我的开发计算机上尝试预编译.
长话短说,预编译在我的开发机器(本地)上失败但是当我试图启动我的测试系统时我得到了这个错误:
Devise/sessions中的Sprockets :: CircularDependencyError #new
/app/assets/stylesheets/application.css已被要求
我确定这与我尝试的预编译有关,即使它失败了,因为在此之前一切正常.
我尝试进行预编译:清除因为我读到了某个会反转/删除预编译的地方.
我在这里错过了什么吗?预编译是否会更改我需要手动重置的配置文件?
这是在Ubuntu 11.10上运行的rails 3.1.
我更喜欢Sass语法而不是Scss语法,但是我注意到后者更受欢迎,并且我担心在Sass中工作,并且以后的版本不再支持它。很抱歉,如果这是一个重复的问题,我在搜索栏中找不到任何答案。
我没有对我的资产进行任何更改,现在突然间,当我执行git push heroku master时,它会对rake资产中止:precompile
...
Preparing app for Rails asset pipeline
Running: rake assets:precompile
I, [2014-03-14T18:30:05.776041 #675] INFO -- : Writing /tmp/build_f664cf41-71b7-435d-b85e-8f607080a4d3/public/assets/application-0a41bdbc9b8fc13f1e62a69634eb2c98.js
rake aborted!
wrong number of arguments (2 for 1)
(in /tmp/build_f664cf41-71b7-435d-b85e-8f607080a4d3/app/assets/stylesheets/application.css.scss)
/tmp/build_f664cf41-71b7-435d-b85e-8f607080a4d3/vendor/bundle/ruby/2.0.0/gems/sass-3.2.14/lib/sass/importers/filesystem.rb:16:in `initialize'
/tmp/build_f664cf41-71b7-435d-b85e-8f607080a4d3/vendor/bundle/ruby/2.0.0/gems/sprockets-2.12.0/lib/sprockets/sass_importer.rb:11:in `initialize'
...
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
Run Code Online (Sandbox Code Playgroud)
它看起来像是在资产/样式表/ application.css.scss中错误的参数数量(2比1).但我的样式表中没有任何方法.这是那个文件:
/*
* This is a manifest …Run Code Online (Sandbox Code Playgroud) 有人可以解释以下命令之间的区别吗?
rake assets:precompile
bin/rake assets:precompile
RAILS_ENV=production rake assets:precompile
RAILS_ENV=production bin/rake assets:precompile
当我尝试在Perl脚本中实现预编译的正则表达式时,我遇到了一些匹配问题.我有脚本工作没有预编译,任何时候我有一个跨越行的快递,它在预编译时不返回任何匹配.例如:
my $regex_partner = qr/<h1 id="PartnerName">(?<partner_name>.*?)<\/h1>/;
$content =~ $regex_partner;
$partner_name = $+{partner_name};
Run Code Online (Sandbox Code Playgroud)
在预编译时工作正常,但是:
my $regex_web =~ qr/Company Website:.*openWindow[(]'(?<website>http:\/\/.*?)'/s;
$content =~ $regex_web;
$website = $+{website};
Run Code Online (Sandbox Code Playgroud)
什么都不返回,但如果我拿出整个预编译就行了.似乎任何时候使用qr // s,它都行不通.
救命?
使用deploy.rb仅在更改时预编译rails资产,此任务总是跳过我的资产的编译:(
namespace :assets do
task :precompile, :roles => :web, :except => {:no_release => true} do
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
end
Run Code Online (Sandbox Code Playgroud)
什么可能导致这个完整的任务没有编译?它总是认为没有资产变化并抛出该消息.
我也从未真正理解任务,例如source.log.local下面的内容是什么?
source.local.log
Run Code Online (Sandbox Code Playgroud)
任何人都可以澄清任务命令的作用,并指出为什么它从未看到任何资产变化?谢谢
deployment capistrano precompile ruby-on-rails-3 asset-pipeline
我已经对我的staging rails应用程序进行了更改.我交换了标题图像,因此想再次预编译资产.上周五它还在工作,现在经过这一小小的变化,它突然失败了.我使用部署脚本执行此操作,该脚本克隆git存储库,然后在将文件夹移动到/ var/www之前调用bundle install和rake任务进行预编译.手动调用webserver目录中的预编译任务会导致相同的错误.
配置是:
Ubuntu 12.04,nginx 1.4.7,ruby 1.9.3,rails 4.0.2
我得到的错误:
ubuntu@ip-xx-xxx-xx-xxx:/var/www/myproject-web$ RAILS_ENV=staging bundle exec rake --trace assets:precompile
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
rake aborted!
Sprockets::FileNotFound: couldn't find file 'jquery.ui.tabs'
(in /var/www/myproject-web/app/assets/javascripts/application.js:15)
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/context.rb:106:in `resolve'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/context.rb:146:in `require_asset'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/directive_processor.rb:217:in `process_require_directive'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/directive_processor.rb:167:in `block in process_directives'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/directive_processor.rb:165:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/directive_processor.rb:165:in `process_directives'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/directive_processor.rb:99:in `evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/context.rb:197:in `block in evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/context.rb:194:in `evaluate'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/processed_asset.rb:12:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/sprockets-2.11.0/lib/sprockets/base.rb:374:in `block …Run Code Online (Sandbox Code Playgroud) 我们已经为 R 包建立了一个简单的本地类似 CRAN 的存储库。有很多用户,他们都使用相同版本的Linux。
有没有办法说服 R 提供预编译的 Linux 包而不是源包?对于使用我们存储库的任何人来说,编译步骤都需要花费大量时间。预编译和重用相同的二进制文件应该是可能的,因为我们可以保证 Linux 版本对所有用户都是一致的。
一个人怎么能把这样的东西放在一起?
我正在努力将新的 Rails 6 应用程序部署到 Heroku。它在我本地运行良好。在部署过程中,我收到以下输出。
不幸的是,我对 webpack 和 Yarn 还很陌生。这似乎是 move-file 的版本/依赖关系问题,而 move-file 又似乎是 webpacker 的依赖关系。但是,我不知道如何解决这个问题。
似乎可以归结为这一行:
error move-file@2.0.0: The engine "node" is incompatible with this module. Expected version ">=10.17". Got "10.15.3"
Run Code Online (Sandbox Code Playgroud)
但是,节点不是我的节点模块之一,但似乎是已安装的二进制文件。当我跑步时
node - v
Run Code Online (Sandbox Code Playgroud)
我得到:v12.16.1
任何帮助将不胜感激。
remote: Removing bundler (2.0.2)
remote: Bundle completed (201.39s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v10.15.3-linux-x64
remote: -----> Installing yarn-v1.16.0
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install …Run Code Online (Sandbox Code Playgroud) precompile ×10
assets ×4
heroku ×2
capistrano ×1
deployment ×1
node.js ×1
package ×1
perl ×1
r ×1
regex ×1
sass ×1
syntax ×1
yarnpkg ×1