草庐IT

pc_file_as_string

全部标签

ruby-on-rails - ruby rails : no such file to load -- openssl on RedHat Linux Enterprise

我正在尝试执行“rakedb:migrate”并收到错误消息“没有要加载的文件--openssl”。“openssl”和“openssl-devel”包都已安装。Debian或Ubuntu上的其他人似乎能够通过安装“libopenssl-ruby”来摆脱这种情况,这不适用于RedHat。有没有人遇到过这个问题并有解决方案? 最佳答案 升级到8.10后,我在Ubuntu上遇到了这个问题。Ubuntu的解决方案是sudoapt-get安装libopenssl-ruby 关于ruby-on-r

ruby-on-rails - 创建新的 Rails 3 项目时出错 : `require' : cannot load such file -- openssl (LoadError)

当我尝试创建一个新项目($railsnewfirst_app)时,它在创建目录结构后出现以下错误。......createvendor/plugins/.gitkeeprunbundleinstall/home/amit/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in`require':cannotloadsuchfile--openssl(LoadError)from/home/amit/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site

ruby - rbenv 和 bundler : "bad interpreter: No such file or directory"

我搞砸了我的配置。我正在运行Ubuntu14.04,当我尝试从一个项目转移到另一个项目时遇到了一些问题。我尝试卸载并重新安装rbenv,然后按照本指南安装了Ruby2.1.7:https://gorails.com/setup/ubuntu/14.04.现在,当我运行geminstallbundler时,没有任何反应,我无法安装任何gem。当我输入bundler或bundler-v我看到这个:/usr/local/bin/bundler:/usr/bin/ruby1.9.1:badinterpreter:Nosuchfileordirectory我花了很多时间试图解决这个问题,但我真的

ruby - 没有将 String 隐式转换为 Integer (TypeError)?

我正在尝试编写一个脚本,该脚本将从使用XMLRPC的RedHatSatellite/Spacewalk获取系统ID。我正在尝试获取ID,这是使用系统名称使用XMLRPC客户端时的第一个值。我引用的是thedocumentation以下使用的方法来自RedHat:#!/usr/bin/envrubyrequire"xmlrpc/client"@SATELLITE_URL="satellite.rdu.salab.redhat.com"@SATELLITE_API="/rpc/api"@SATELLITE_LOGIN="********"@SATELLITE_PASSWORD="*****

ruby - Heroku 应用程序无法启动 - `require' : no such file to load -- sinatratestapp (LoadError)

我正在尝试使用bamboo-mri-1.9.2堆栈运行我的Heroku应用程序。当然,它在Ruby1.9.2上本地运行良好。但是在生产环境中,它在执行config.ru的启动过程中崩溃,如下所示:require'sinatratestapp'runSinatra::Application我的.gems文件:sinatra--version'>=1.0'应用程序本身为sinatratestapp.rb:require'rubygems'require'sinatra'get'/'do"HellofromSinatraonHeroku!"end这就是我在项目中得到的所有内容,并尝试在Her

ruby-on-rails - `name' :String 的未定义方法 "SystemTimer"

我在让一年内无法运行的旧RubyonRails2应用程序运行时遇到问题。我正在尝试在我的项目目录的根目录中运行raketest:functionals,但我得到的是undefinedmethod'name'for"SystemTimer":String。我已将我认为与问题相关的所有内容粘贴到此处:http://pastebin.com/NgBvystZ此外,当我自己运行rake时,我得到运行测试时出错:units!不确定如何调试。我已经复制并粘贴了我认为对理解这个问题有用的所有内容。非常感谢您的宝贵时间。谢谢。 最佳答案 这是高于1

ruby-on-rails - 重新归档 gem : multiple file uploads

我正在使用Refile和Rails4。我正在按照他们的教程进行multipleimageupload.每个帖子可以有多个图像。我的模型看起来像这样:后.rb:has_many:images,dependent::destroyaccepts_attachments_for:images,attachment::file图片.rb:belongs_to:postattachment:file我可以上传文件,使用:但是当我尝试检索像这样的图像时:我得到错误:undefinedmethodfilefor#如何使用多张图片上传来检索带有refile的图片? 最佳答案

ruby-on-rails - array * string 在 Ruby 中是什么意思?

我在查看一些Rails源代码时偶然发现了#Filevendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/css.rb,line129129:deftarget!130:@target*''131:end*''是做什么的?那是乘以一个空字符串......?你为什么要那样做。 最佳答案 这是一个奇怪的语法。这些是等价的:>>[1,2,3]*'joiner'=>"1joiner2joiner3">>[1,2,3].join'joiner'=>"

ruby-on-rails - 在 RSpec 中使用 Ruby 1.9.2 需要 lib 带来 "no such file to load"

我正在尝试将我的一个Rails项目升级到Ruby1.9.2。一切进展顺利,但一个RSpec测试失败了。在这个测试中,我需要一个Rubylib:#filespec/models/my_lib_spec.rbrequire'spec_helper'require'lib/services/my_lib'describe"MyLib"doit"shoulddosomething"do...库看起来像这样:#filelib/services/my_lib.rbclassMyLibdefself.do_something...在Ruby1.8.7(REE)中测试运行良好:$ruby-vruby1

ruby-on-rails - Ruby 1.8.7(或 Rails 2.x)中的 String.force_encoding()

是否有在Ruby1.8.7(或Rails2.x)中使用String.force_encoding()的解决方案,以便它像在Ruby1.9中一样工作?我读了一些关于requireactive_support的内容,但这不起作用$>gem列表--本地|grep'rails\|activesupport'activesupport(3.0.3,2.3.8,2.3.5)rails(2.3.8,2.3.5)$>ruby-vruby1.8.7(2010-08-16patchlevel302)[i686-darwin10.4.0]$>rails-vRails2.3.8IRB:>require"rub