gpt4 book ai didi

ruby-on-rails - Ruby on Rails Rakefile 错误

转载 作者:太空宇宙 更新时间:2023-11-03 17:24:31 25 4
gpt4 key购买 nike

当我将我的 ruby​​ on rails 应用程序推送到 heroku 时,所有图像都不会加载。

我试图预编译所有 Assets ,但出现此错误:

jack:my_first_ruby_app Jack$ bundle exec rake assets:precompile
rake aborted!
/Users/Jack/Sites/my_first_ruby_app/Rakefile:1: unknown regexp option - b
/Users/Jack/Sites/my_first_ruby_app/Rakefile:1: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:589:in `raw_load_rakefile'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:89:in `block in load_rakefile'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:88:in `load_rakefile'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:72:in `block in run'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195@global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
/Users/Jack/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

Rakefile 的内容:

/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

MyFirstRubyApp::Application.load_tasks

Ruby 2.0.0p195 版本

最佳答案

请编辑您的Rakefile

并注释了第一行

像这样

#!/usr/bin/env rake

关于ruby-on-rails - Ruby on Rails Rakefile 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17161559/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com