当我将rails应用程序部署到Heroku时,我一直很难将我的背景图像显示出来。 我终于在Heroku文档中找到了这个: 在Rails 4中,链轮只会产生摘要文件名。 这意味着您必须使用此类ERB帮助程序来引用您的资产: 确保为使用ERB帮助程序的app / assets中的任何文件添加.erb扩展名。 因此application.css需要是application.css.erb。 我尝试将带有令人讨厌的背景图像的style.css.scss文件重命名为style.css.scss.erb 。 这使我能够将违规背景图像的链接更改为: background: no-repeat center center fixed; 但是,我不知道这是否是让Heroku实际显示我的图像的神奇子弹,因为我现在正在获取File to import not found or unreadable:文件File to import not found or unreadable:该文件的错误。 我在这个问题上做了一些非常广泛的谷歌搜索,但似乎无法找到摆脱错误的方法。 任何帮助或智慧都会很棒!
Heroku为使用HyPDF将HTML转换为PDF格式的用户提供以下建议 : Place your styles and scripts within and tags instead of loading them using tag. 目前,我正在使用以下内容: = stylesheet_link_tag “print”, :media => “print, screen, projection” 什么是Rails 3.2代码生成与嵌入式非链接CSS的等价物? (这是因为Rails会自动将/app/assets/stylesheets/print.scss所有CSS插入到它生成的HTML中,而不是手动将所有CSS复制粘贴到content_tag ,然后必须保留其中的内容标签。) 在API文档中找不到任何内容。 谢谢。
很难推到heroku。 我使用最新版本的rails和ruby。 每次我尝试上传到heroku时都会收到此消息。 [code] $ git push heroku master警告:永久性地将IP地址’50 .19.85.132’的RSA主机密钥添加到已知主机列表中。 初始化存储库,完成。 计数对象:69,完成。 Delta压缩使用多达8个线程。 压缩对象:100%(58/58),完成。 书写对象:100%(69/69),15.99 KiB | 0字节/秒,完成。 总计69(delta 5),重复使用0(delta 0) —–> Ruby app detected —–> Compiling Ruby/Rails /app/tmp/buildpacks/ruby/lib/language_pack/helpers/bundler_wrapper.rb:88:in `block in ruby_version’: There was an error parsing your Gemfile, we cannot continue (LanguagePack::Helpers::BundlerWrapper::GemfileParseError) There was an error in your Gemfile, and Bundler cannot continue. from […]
我正在使用Heroku,电子邮件不会在开发中发送出去,而是在生产中正确发送。 我想在Heroku上运行一个单独的暂存实例,但不希望发送电子邮件(只是发送到日志)。
我是Ruby on Rails的新手。 我使用:/ Cloud9使ROR应用程序/ GitHub存储文件并更新它们/ Hiroku作为免费服务进行生产 当我在Cloud9上运行应用程序时,它可以正常工作: https : //ruby2016-bbparis.c9users.io/ 当我把它推到GitHub时,它在Heroku上不起作用,我得到: 您要查找的页面不存在。 您可能输错了地址或页面可能已移动。 如果您是应用程序所有者,请检查日志以获取更多信息。 捕获屏幕 我的路线文件很简单: Rails.application.routes.draw do root ‘pages#home’ get ‘pages/about’, to: ‘pages#about’ end 我该如何解决这个问题?
我最近更新了我们的Gemfile作为pry pry-byebug和bye-bug导致Rubymine因为我的一些同事而崩溃。 由于我们中的一些人使用其他编辑器,我已经为我们的Gemfile添加了一个环境变量: if ENV[“USE_DEBUGGER”] gem “pry-byebug” gem “byebug” end 这在我们的本地机器上运行良好,但部署到Heroku会导致以下错误: gist 我已经尝试运行bundle install并提交一个新的Gemfile.lock但是没有任何改变。 摆脱控制流声明或简单地删除gem修复了这个问题。在同一个提交中,我将所需的ruby版本提升到2.2.0是没有价值的。 有没有办法在没有吹Heroku的情况下在Gemfile使用条件语句?
我已经从第4轨道升级到第5轨道。很棒。 添加了Foundation 6 topbar,推送到了heroku。 没有什么失败,但网站没有加载。 heroku run logs显示: 错误是: ActionView :: Template :: Error(意外的令牌punc«(»,预期的punc«:»(行:23041,col:10,pos:685332)错误 这里有问题吗?
我正在尝试将Rails应用程序推送到Heroku,但是当它尝试构建rmagick gem(在Gemfile中指定)时它失败了。 我在本地完成了bundle install ,应用运行正常。 但是,在预接收钩子中的Heroku上,在构建rmagick示例之后,我得到: make install /usr/ruby1.8.7/bin/ruby setup.rb install rm -f InstalledFiles —> lib mkdir -p /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib install RMagick.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/ —> lib/rvg mkdir -p /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install embellishable.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install pathdata.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install stylable.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install describable.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install deep_equal.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install misc.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install text.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install rvg.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install container.rb /disk1/tmp/build_3eu8mw7r34j0f/.bundle/gems/ruby/1.8/gems/rmagick-1.15.17/lib/rvg install […]
我刚刚在heroku上部署了我的应用程序。 我跑了: heroku ps:scale web=1 运行正常,但是当我想检查使用heroku ps的dyno时,我得到了以下内容: === web (1X): `bin/rails server -p $PORT -e $RAILS_ENV` web.1: crashed 2015/01/19 11:18:38 (~ 3m ago) heroku日志: 2015-01-19T15:14:06.131511+00:00 heroku[router]: at=error code=H10 desc=”App crashed” method=GET path=”/favicon.ico” host=rock-paper-scissors-test.herokuapp.com request_id=27ca44cb-ca4e-473e-9789-0245d393bd56 fwd=”190.15.209.212″ dyno= connect= service= status=503 bytes= 有任何想法吗? 更新: 在退出heroku日志之前获取以下行: 2015-01-19T15:28:57.189329+00:00 app[web.1]: => Notice: server is listening on all interfaces (0.0.0.0). Consider […]
我有2个型号: class User :destroy .. def add_post(post) self.micro_posts << post end class MicroPost < ActiveRecord::Base belongs_to :user … 和迁移: class CreateMicroPosts < <ActiveRecord::Migration def change create_table :micro_posts do |t| … 当我在heroku服务器上调用add_post时,我收到一个错误: 2012-02-06T02:59:58+00:00 app[web.1]: ActiveRecord::StatementInvalid (ArgumentError: wrong number of arguments (1 for 0): INSERT INTO “micro_posts” (“created_at”, “description”, “pub_date”, “tag”, “title”, “updated_at”, “url”, “user_id”) VALUES ($1, […]