草庐IT

DOT_PATH

全部标签

ruby - Windows 7 - 如何解决 “You need to have Ruby and Sass installed and in your PATH for this task to work” 警告?

大多数答案和解决方案都与OSX相关,它集中在Windows7中:我已经全局安装了Grunt&GruntCLI。然后我在项目文件夹中执行了npminstall以安装所有依赖项。到目前为止没有问题,但是当我尝试运行“gruntbuild”命令时,我在我的项目中收到了这个警告:Warning:YouneedtohaveRubyandSassinstalledandinyourPATHforthistasktowork.Moreinfo:https://github.com/gruntjs/grunt-contrib-sassUse--forcetocontinue.

ruby - 将 RVM 与 virtualenv 一起使用时为 "Warning! PATH is not properly set up"

我收到这个错误:Warning!PATHisnotproperlysetup,'/home/oscar/.rvm/gems/ruby-2.1.2/bin'isnotatfirstplace,usuallythisiscausedbyshellinitializationfiles-checkthemfor'PATH=...'entries,itmightalsohelptore-addRVMtoyourdotfiles:'rvmgetstable--auto-dotfiles',tofixtemporarilyinthisshellsessionrun:'rvmuseruby-2.1.

ruby-on-rails - 带有 path_prefix 的浅层路由?

最近我在我的一个应用程序中更改了一些嵌套资源以使用浅层路由。它运行良好,我已经能够简化我的View和Controller。但是,我之前一直在使用path_prefix:map.with_options:path_prefix=>"blog"do|blog|blog.resources:postsdo|posts|posts.resources:commentsendend请注意,所有路由都按预期以“/blog”为前缀。#$rakeroutes#postsGET/blog/posts(.:format){:controller=>"posts",:action=>"index"}#POS

ruby-on-rails - 确定 Journey::Path::Pattern 是否匹配当前页面

我正在尝试使用概述的方法thispost结合url_for来确定当前路径是否在已安装的引擎中,但我很难弄清楚如何使用Journey::Path::Pattern(这是另一篇文章中概述的mounted_pa​​th方法返回的内容)。classRails::Enginedefself.mounted_pathroute=Rails.application.routes.routes.detectdo|route|route.app==selfendroute&&route.pathendend除了theofficialdocumentation,似乎没有太多关于它的讨论。,这不是特别有用。

ruby-on-rails - Heroku "at=error code=H10 desc="应用程序崩溃“method=GET path=/favicon.ico”

我有一个简单的Rails应用程序,可以在本地主机(MacOSX)上正常运行,但是当我将它部署到Heroku时,我看到一个页面出现此错误:应用程序错误应用程序发生错误,无法提供您的页面。请稍后重试。如果您是应用程序所有者,请查看您的日志以了解详细信息。我真的不知道我在这里做什么;我无法理解herokulogs的输出:2013-04-08T03:25:02+00:00app[web.1]:=>BootingWEBrick2013-04-08T03:25:02+00:00app[web.1]:=>Rails3.2.12applicationstartinginproductiononhttp

ruby-on-rails - 如何使用 cache_path 使 caches_action 过期?

我正在使用以下缓存索引操作:caches_action:index,:cache_path=>Proc.new{|c|c.params}expire_action:action=>:indexexpire_action似乎只是在没有任何参数的情况下使索引操作过期。如何使与索引相关的所有caches_action过期?(这是一个Rails2.3.5应用程序) 最佳答案 如果你没有使用memcached,你可以使用带正则表达式的expire_fragment:expire_fragment(Regexp.new("/yourpath/y

ruby-on-rails - 消息 : Failure/Error: require File. expand_path ('../../config/environment' , __FILE__)

首先,我阅读了其他有类似问题的用户的帖子,但无法找出我的错误所在。我想在以下文件上使用RSpec开始测试:dashboard_view_spec.rb:require'rails_helper'RSpec.feature"Dashboard",type::featuredobefore(:each)do@current_user=User.create!(email:"xyz@xyz.com",password:"xyz123")sign_in_with(@current_user.email,@current_user.password)end#NAVBARRSPECTESTscen

ruby-on-rails - gem 未加载 : NameError (uninitialized constant) | But gem works in local path

我买了一台新机器并全新安装了rbenv(我之前一直使用rvm)。Thisgem现在不会加载到我的应用程序中。我没有做任何代码更改。现在和那时的唯一区别是rbenv。Loadingdevelopmentenvironment(Rails5.2.1)irb(main):001:0>SportsApi::Fetcher::Score::NBATraceback(mostrecentcalllast):1:from(irb):1NameError(uninitializedconstantSportsApi::Fetcher)有趣的是,如果我将gem克隆到我的本地机器,然后更改Gemfile中

ruby-on-rails - Heroku 部署崩溃 rails 服务器语法错误 File.expand_path ("../spring", __FILE__)

在Heroku上部署时,服务器崩溃并显示此信息rails服务器语法错误File.expand_path("../spring",FILE)尽管在本地工作时一切正常。这是我的铁路文件beginloadFile.expand_path("../spring",__FILE__)rescueLoadErrorendAPP_PATH=File.expand_path('../../config/application',__FILE__)require_relative'../config/boot'require'rails/commands'你对这个问题有什么想法吗?谢谢

ruby 需要 './blahblah.rb' 与需要 File.expand_path ('../blahblah' , __FILE__)

有什么区别require'blahblahlblah.rb'对比require'./blahblah.rb'对比requireFile.expand_path('../blahblah',__FILE__)我看到它们都被使用了。想知道什么更好,在什么情况下一个比另一个更好。谢谢! 最佳答案 requireblaba.rb正在搜索您的默认gem路径以加载文件,这取决于您使用的ruby​​版本。例如,RVM将在$HOME/.rvm/rubies/...中搜索,而系统范围的ruby​​将在发行版的默认路径中搜索。请注意,这是gems所在的