草庐IT

last-error

全部标签

ruby-on-rails - 移至生产服务器的 Rails 应用出现 "dump format error for symbol"错误

我刚刚将我的Rails应用程序从开发服务器转移到部署服务器。我已经安装了passenger,但我想尝试使用railss来确保一切正常(这是我第一次开发和部署rails应用程序)。规范是:Ruby1.9.3和RVM、mod_passenger、Rails3.2.3。全部安装正确,我还启用了Apache模块。顺便说一句,出了点问题(乘客一直在说“错误信息:未知key:类(class)”。)运行railss会出现上面列出的奇怪错误dumpformaterrorforsymbol(0x45)ProcessingbyDevise::SessionsController#newasHTMLRend

ruby-on-rails - Ruby on Rails Rake Assets :precompile error

我是Rails开发的新手,这是我第一次部署到Heroku。当我执行我的应用程序时(部署后)出现错误:2011-09-18T21:05:54+00:00app[web.1]:Completed500InternalServerErrorin10ms2011-09-18T21:05:54+00:00app[web.1]:2011-09-18T21:05:54+00:00app[web.1]:ActionView::Template::Error(application.cssisn'tprecompiled):我在谷歌上搜索了一下,发现我必须预编译我的Assets,但在尝试这样做时我发现了

ruby-on-rails - ERROR : While executing gem . .. (TypeError) 不兼容的编码文件格式(无法读取)

我在使用Ruby2.4.4版和macOSMojave运行bundleinstall时遇到了这个问题:Fetchingnokogiri1.8.5Installingnokogiri1.8.5withnativeextensionsGem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension.ERROR:cannotdiscoverwherelibxml2islocatedonyoursystem.pleasemakesure`pkg-config`isinstalled.所以我跑了xcode-select--install但是当我运

【笔记】internal/modules/cjs/loader.js:985 throw err; ^ Error: Cannot find module ‘node:util‘

[root@localhostusr]#cnpm-vinternal/modules/cjs/loader.js:985throwerr;^Error:Cannotfindmodule‘node:util’Requirestack:/usr/local/node/lib/node_modules/cnpm/bin/cnpmatFunction.Module._resolveFilename(internal/modules/cjs/loader.js:982:15)atFunction.Module._load(internal/modules/cjs/loader.js:864:27)atM

ruby - Pry Error : Cannot find local context. 您是否使用了 `binding.pry`?

为什么我会收到此pry动错误?[36]pry(main)>s="pry"Error:Cannotfindlocalcontext.Didyouuse`binding.pry`?在此截屏视频中运行良好http://pryrepl.org/ 最佳答案 似乎s、c和n是pry-navgem上的保留命令,发现here,这可以帮助您逐步完成绑定(bind)。Pry.commands.alias_command'c','continue'Pry.commands.alias_command's','step'Pry.commands.alias

ruby-on-rails - ActionView::Template::Error:缺少要链接到的主机

正如标题所暗示的,当我尝试在我的邮件程序模板中使用link_to时出现此错误:ActionView::Template::Error:Missinghosttolinkto!Pleaseprovidethe:hostparameter,setdefault_url_options[:host],orset:only_pathtotrue我尝试按照它的说明进行操作,并且还找到了thispost,但我仍然收到错误。我尝试将config.action_mailer.default_url_options={host:'example.com'}添加到以下每个文件,但没有一个有效:/confi

ruby - 在 Ubuntu 上安装 ruby​​-odbc gem 时出现 "ERROR: sql.h not found"

尝试在Debian/Ubuntu上安装ruby​​-odbcgem会导致以下错误;“错误:找不到sql.h” 最佳答案 这也发生在OSX上,所以brew来拯救:brewinstallunixodbc 关于ruby-在Ubuntu上安装ruby​​-odbcgem时出现"ERROR:sql.hnotfound",我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/17068590/

ruby-on-rails - 为什么 Rails 的 "errors.full_messages"不替换属性和消息变量?

我刚刚创建的Rails模型出现了一个奇怪的问题。这是我的验证:validates_presence_of:from_name,:message=>'Pleaseprovideafromname.'validates_presence_of:from_emailvalidates_presence_of:giftition_plan_id我在表单中使用errors.full_messages和f.error_messages时遇到问题:g=Giftition.createg.errors.first=>["from_name","Pleaseprovideafromname."]>>g.

ruby-on-rails - Phusion Passenger Error : You have activated rack 1. 2.1,但是你的 Gemfile 需要 rack 1.2.2

我正在尝试在Dreamhost共享服务器上运行RubyonRails应用程序。到目前为止一切都很好,除了一个我无法解决的奇怪错误。有时,当我访问网络应用程序时,会出现PhusionPassenger错误提示,Youhavealreadyactivatedrack1.2.1,butyourGemfilerequiresrack1.2.2.Considerusingbundleexec.当我只是刷新页面时,它似乎可以正常工作-不再显示PhusionPassenger错误消息。跟随其他堆栈溢出线程和类似的Dreamhostwiki,我将以下内容添加到config/environment.rb

ruby-on-rails - rails : how to show user's "last seen at" time?

我正在使用存储current_sign_in_at和last_sign_in_at日期时间的设备。但是假设用户在一个月前登录但最后一次查看页面是在5分钟前?有什么方法可以显示(“5分钟前用户最后一次出现”)。 最佳答案 这个怎么样:创建迁移以向用户添加新字段以存储用户最后一次出现的日期和时间:railsgmigrationadd_last_seen_at_to_userslast_seen_at:datetime向您的应用程序Controller添加一个操作前回调:before_action:set_last_seen_at,if: