草庐IT

ruby - Rails 3 db :migrate 的未定义方法 `visitor'

我在Rails3中进行数据库迁移时遇到异常。undefinedmethod`visitor'for#编辑请查看解决方案here.在我的项目中没有出现字符串visitor所以我很困惑。这是完整的转储:$rakedb:migrate--trace**Invokedb:migrate(first_time)**Invokeenvironment(first_time)**Executeenvironment**Invokedb:load_config(first_time)**Invokerails_env(first_time)**Executerails_env**Executedb:l

ruby - 加载两个同名的 Ruby 模块/Gems

我正在尝试使用两个Gem访问AmazonWebServices(AWS)。一个是亚马逊的“aws-sdk”,另一个是“amazon-ec2”。我使用的是第二个,因为aws-sdk不涵盖亚马逊服务的cloudwatch部分。问题是两者都加载到同一个命名空间中。require'aws-sdk'#aws-sdkgemrequire'AWS'#amazon-ec2gemconfig={:access_key_id=>'abc',:secret_key=>'xyz'}#startusingtheAPIwithaws-sdkec2=AWS::EC2.new(config)#startusingth

ruby-on-rails - 运行 "bin/rake assets:precompile"时未设置 I18n 加载路径!

我正在使用I18n-js,我的客户端I18n.t调用在生产环境中运行时都会返回翻译缺失消息。开发测试一切正常。这个问题的根源似乎在于Assets管道。I18n.load_path不包含我的任何翻译(当运行bin/rakeassets:precompile时)它只包含以下路径:["/home/chris/.rvm/gems/ruby-1.9.3-p125@Project/gems/activesupport-3.2.3/lib/active_support/locale/en.yml","/home/chris/.rvm/gems/ruby-1.9.3-p125@Project/gems

ruby - Ruby 守护进程中的错误文件描述符

在MacOSXLion上使用Rubyv1.8.7和Daemonsv1.1.8,我试图编写一个消费者进程并让它作为守护进程运行:#config[:name]=>'idx_my_delete_consumer'#config[:daemon]=>{:multiple=>false,#:backtrace=>true,#:dir_mode=>:normal,#:log_dir=>'/Users/pprakash/consumer.log',#:monitor=>true,#:dir=>'/Users/pprakash/pids'}Daemons.run_proc(config[:name],

ruby-on-rails - rake 数据库 :migrate not working on my postgres db

好的,所以我有一个Rails应用程序,我试图在postgres数据库上运行迁移,我通常使用mysql,一切都很好,但是当我运行命令时,我得到了这个rakedb:migrate(in/Users/tamer/Sites/my_app)/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/activerecord-3.0.3/lib/active_record/connection_adapters/postgresql_adapter.rb:487:[BUG]Segmentationfaultruby1.9.2p290(2011-07-09

ruby - 使用 RVM,当 gems 安装在不同的 ruby​​ 版本中时,bundler 不会安装在正确的 gemset 中

我在使用rvm、bundler和gemsets时遇到问题。我在rvm中安装了3个ruby:rvmrubiesmacruby-0.7.1[x86_64]ree-1.8.7-2010.02[x86_64]=>ruby-1.9.2-p0[x86_64]像这样的gemsets:rvmgemsetsmacruby-0.7.1[x86_64]ree-1.8.7-2010.02[x86_64]ree-1.8.7-2010.02@chef[x86_64]ree-1.8.7-2010.02@global[x86_64]ree-1.8.7-2010.02@mobi[x86_64]ree-1.8.7-201

ruby - 如何使用 TeamCity 在所有代理上安装 Ruby gems?

我正在开发Teamcity6.5.6,并正在寻找一种在构建代理上自动安装所需的ruby​​GEMS的方法。例如:假设我在每个代理/远程(构建)机器上都需要两个gem。例如:Watir和Seleniumgem。然后我想通过登录到这些机器手动安装它们,或者我可以将它们保存在SVN中的公共(public)库文件夹中,并在Teamcity中执行一些任务以安装它们(如果机器上不存在)。如果是这样,那么Teamcity中的任务是什么?谢谢 最佳答案 看看Bundler.您可以在Gemfile中维护所需gem的列表,然后在开始构建之前在每台机器上

ruby - 参数错误 : wrong number of arguments (1 for 0) when using afer_save

ArgumentError:wrongnumberofarguments(1for0)from/Users/Castillo/Desktop/gainer/app/models/status.rb:13:in`update_remaining_nutrients'from/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.11/lib/active_record/associations/collection_association.rb:507:in`blockincallback'from/usr/local/rvm/

ruby - 使用 s3 gem + rails 4.1.5 时不允许将 `@@{' 作为类变量名称(SyntaxError)

我知道已经有人问过这种类型的问题了。我使用s3gem将我的文件上传到s3存储桶中。但是在安装s3gem之后,当我启动railsserver时它显示了这个错误:/var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:in`class_eval':/var/lib/gems/1.9.1/gems/aws-s3-0.6.3/lib/aws/s3/extensions.rb:223:`@@{'isnotallowedasaclassvariablename(SyntaxError)/var/lib/gems/1.9.

ruby - 安装 libv8 3.11.8.3 时出错

我正在运行全新安装的OSX10.9Mavericks和XCode5.0.1。当我尝试在我的项目中运行bundleinstall时,它无法安装libv8gem。这是输出:ERROR:Errorinstallinglibv8:ERROR:Failedtobuildgemnativeextension./Users/user1/.rvm/rubies/ruby-1.9.3-p448/bin/rubyextconf.rbcreatingMakefileConfiguredwith:--prefix=/Applications/Xcode.app/Contents/Developer/usr--