Tag: rubygems

无法更新RubyGems

我在将RubyGems从1.1.1版更新到最新版时遇到了困难。 我尝试过以下方法: gem更新 结果: 更新已安装的gem 批量更新Gem源索引: http : //gems.rubyforge.org/ 无需更新 和 gem install ruby​​gems-update 结果: 批量更新Gem源索引: http : //gems.rubyforge.org/ 批量更新Gem源索引: http : //gems.rubyforge.org/ 错误:安装rubygems-update时出错: rubygems-update需要构建器(> = 0) 和 gem install ruby​​gems-update update_rubygems 结果: 批量更新Gem源索引: http : //gems.rubyforge.org/ 批量更新Gem源索引: http : //gems.rubyforge.org/ 错误:安装rubygems-update时出错: rubygems-update需要构建器(> = 0) 错误:无法在本地或存储库中找到update_rubygems 然后我按照类似问题的建议检查了我是否在我的远程资源中使用了http://gems.rubyforge.org/ 。 这是gem环境: RubyGems环境: – RUBYGEMS版本:1.1.1 – RUBY版本:1.8.6(2008-08-11 patchlevel […]

`add_frozen_gem_path’:Gem的未定义方法`source_index’:模块(NoMethodError)或不推荐使用Gem.source_index

我使用rails 2.3.11,ruby-1.9.2-p320。 尝试运行脚本/服务器,但收到此错误: – system@admin:~/apps/app_name/trunk$ script/server => Booting WEBrick => Rails 2.3.11 application starting on http://0.0.0.0:3000 /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path’: undefined method `source_index’ for Gem:Module (NoMethodError) from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/initializer.rb:298:in `add_gem_load_paths’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/initializer.rb:132:in `process’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/initializer.rb:113:in `run’ from /home/system/apps/app_name/trunk/config/environment.rb:9:in `’ from /home/system/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:126:in `require’ from /home/system/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:126:in `require’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `block in require’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:547:in `new_constants_in’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/activesupport-2.3.11/lib/active_support/dependencies.rb:182:in `require’ from /home/system/.rvm/gems/ruby-1.9.2-p320@gemset_name/gems/rails-2.3.11/lib/commands/server.rb:84:in […]

如何告诉Bundler使用全系统安装的gems(生产部署)?

当使用Capistrano部署Rails应用程序时,我希望Bundler只在已经找到全系统安装的gems的情况下才能将gem安装到shared/bundles目录。 我该怎么做? 例如,如果我已经在系统上安装了pg gem v 0.14 ,我希望Bundler使用它,而不是在我的应用程序的shared/bundles目录中构建和安装新的。 我正在使用Ubuntu Server,并为多个用户安装了RVM。

在gem中转换ActiveRecord的扩展名

这个扩展为所有app模型创建了cache_find方法(我使用这篇文章创建了这个)。 配置/ active_record_extension.rb require ‘active_support/concern’ module ActiveRecordExtension extend ActiveSupport::Concern # add your instance methods here def flush_find Rails.cache.delete([self.class.name, :cached_find, id]) end included do after_commit :flush_find end module ClassMethods def cached_find id Rails.cache.fetch([self.name, :cached_find, id]) { self.find(id) } end end end # include the extension ActiveRecord::Base.send(:include, ActiveRecordExtension) 我将此代码转换为gem并添加到此repo中 。 所以我想动态添加这些方法,如下所示: class User << ActiveRecord::Base # id, […]

找不到RubyGem栏杆

我尝试使用“rails new”命令创建新的应用程序但是出现此错误: ‘report_activate_error’: Could not find RubyGem railties (>= 0) (Gem::LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:244:in ‘activate_dep’ from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:236:in `activate’ from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1307:in `gem’ from /usr/local/bin/rails:18 知道为什么吗? 顺便说一句,我在Ubuntu上工作 gem list *** LOCAL GEMS *** 它是空的,但我之前安装了rails

Rails 3.1 ckeditor

所以我只是尝试在rails中安装ckeditor,但它看起来不像它的工作。 这就是我做的 将这些行添加到我的gemfile中 gem “ckeditor”, “~> 3.6.0” gem “paperclip” 然后捆绑安装并运行 rails generate ckeditor:install rails generate ckeditor:models –orm=active_record 添加了此文件tom config/application.rb config.autoload_paths += %W(#{config.root}/app/models/ckeditor) 然后我尝试了这段代码: cktext_area_tag(“test_area”, “Ckeditor is the best”) cktext_area_tag(“content”, “Ckeditor”, :input_html => {:cols => 10, :rows => 20}, :toolbar => ‘Easy’) 但是,我得到的只是两个没有任何编辑能力的textareas。 它们看起来像普通的textareas,我所能做的就是擦除和添加文本。 我究竟做错了什么?

Rails4 Friendly_id独特的Slug格式

我正在使用friendly_id gem来阻止我的模型。 因为当我输入相同的数据来检查时,slug必须是唯一的,我会在slug中附加一个长的哈希值。 Explore explore Explore explore-7a8411ac-5af5-41a3-ab08-d32387679f2b 有没有办法告诉friendly_id提供更好的格式化slug,如explore-1和explore-2 版本: friendly_id 5.0.4

Ruby的has_header方法在哪里查找头文件?

在CentOS 5.7的盒子里,我在安装最新版本的mysql2 gem时遇到了麻烦; 它找不到errmsg.h: /usr/bin/ruby extconf.rb checking for rb_thread_blocking_region()… yes checking for rb_wait_for_single_fd()… no checking for mysql_query() in -lmysqlclient… yes checking for mysql.h… no checking for mysql/mysql.h… yes checking for errmsg.h… no —– errmsg.h is missing. please check your installation of mysql and try again. —– *** extconf.rb failed *** mysql头文件存在于/ usr / include / […]

设计gem跳过确认并立即通过电子邮件跳过确认

我正在使用设计gem,在创建用户时我想跳过混乱! 并跳过confimation电子邮件,例如: User.create(:first_name => “vidur”, :last_name => “punj”).confirm!.skip_confirmation! 但它只跳过确认,不会跳过发送确认电子邮件。 任何人都可以给我一个跳过这两个想法的想法。

捆绑安装不能脱机工作

我遇到了这个问题。 我认为安装了捆绑器。 而且因为我无法在RoR中创建应用程序时捆绑安装,或者直接在项目中捆绑安装。 如果您有任何问题,请帮助我,并找到解决方案。 enter code here :run bundle install :Fetching gem metadata from https://rubygems.org/. :Error Bundler::HTTPError during request to dependency API :Fetching full source index from https://rubygems.org/ :Could not reach https://rubygems.org/