rubygems

Rails Gemfile defaults to 'https' - 'bundle install' fails

烂漫一生 提交于 2020-01-12 10:16:11
问题 I've noticed that when generating a new rails project, the Gemfile now defaults to: source 'https://rubygems.org' instead of source 'http://rubygems.org' and now bundle install fails for me. When it attempts to run, I get: /Users/<my user name>/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault If I manually change the Gemfile to http , then bundle install performs fine. Is there an error with my setup (I've replicated this on two different boxes), or is there

How to use Reform to prepopulate for featured objects?

廉价感情. 提交于 2020-01-12 08:50:55
问题 When a user clicks, for example, "Take a Picture" how can we prepopulate the create.html.erb form with attributes specifically set for that featured challenge, like do for 12 days and do on Tue, Thu ? I am using the reform gem. #challenges_controller def new @challenge = Challenge.new respond_modal_with @challenge, location: root_path end #challenges/new.html.erb <%= simple_form_for(@challenge, html: { data: { modal: true } }) do |f| %> <%= f.text_field :action, placeholder: 'Enter a Custom

How to parse days/hours/minutes/seconds in ruby?

拜拜、爱过 提交于 2020-01-12 07:11:46
问题 Is there a gem or something to parse strings like "4h 30m" "1d 4h" -- sort of like the estimates in JIRA or task planners, maybe, with internationalization? 回答1: Posting a 2nd answer, as chronic (which my original answer suggested) doesn't give you timespans but timestamps. Here's my go on a parser. class TimeParser TOKENS = { "m" => (60), "h" => (60 * 60), "d" => (60 * 60 * 24) } attr_reader :time def initialize(input) @input = input @time = 0 parse end def parse @input.scan(/(\d+)(\w)/)

rvm install 1.9.2 fails when running autoconf?

落爺英雄遲暮 提交于 2020-01-12 04:37:14
问题 when I run rvm install 1.9.2 I get an error trying to run autoconf. This is the stacktrace: kenmare:ruby-1.9.2-p0 lee$ rvm install 1.9.2-p0 /Users/lee/.rvm/rubies/ruby-1.9.2-p0, this may take a while depending on your cpu(s)... ruby-1.9.2-p0 - #fetching ruby-1.9.2-p0 - #extracted to /Users/lee/.rvm/src/ruby-1.9.2-p0 (already extracted) Running autoconf Error running 'autoconf', please check /Users/lee/.rvm/log/ruby-1.9.2-p0/autoconf.error.log Skipping configure step, 'configure' does not

jRails Alternative

南笙酒味 提交于 2020-01-11 20:21:45
问题 do you know an alternative to jrails? It's more or less outdated (uses jQuery 1.5 - now 1.7 is the current release). Does anybody know an alternative? Thanks EDIT: I know how to build the rails helper with jquery allone - but I like the rails helpers, so I dont want to use jquery allone (without jrails) 回答1: Right now there's no real alternative. However, you can install jRails then upgrade the jQuery installation simply replacing the javascript files (except jrails.js) in the javascripts

When a gem fails, where do I find the mkmf.log file?

折月煮酒 提交于 2020-01-11 15:14:11
问题 Can't find the 'libpq-fe.h header ** extconf.rb failed ** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. Where do I find the mkmf.log file? 回答1: The mkmf.log file can be found under the gem's installation directory. rvm If you are using RVM, then look for a directory similar to ~/.rvm/gems/ruby-1.9.3-p194/gems/some-cool-gem-name/ext/mkmf.log You can list all the mkmf.log files available with this

When a gem fails, where do I find the mkmf.log file?

最后都变了- 提交于 2020-01-11 15:13:36
问题 Can't find the 'libpq-fe.h header ** extconf.rb failed ** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. Where do I find the mkmf.log file? 回答1: The mkmf.log file can be found under the gem's installation directory. rvm If you are using RVM, then look for a directory similar to ~/.rvm/gems/ruby-1.9.3-p194/gems/some-cool-gem-name/ext/mkmf.log You can list all the mkmf.log files available with this

Why is Ruby 1.9.2 on Windows 7 using a 1.9.1 path for gems? it is using c:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb

孤街醉人 提交于 2020-01-11 12:54:47
问题 I installed Ruby 1.9.2 using one click installer to c:\ruby192 It doesn't set any path, so I set it to include c:\ruby192 at the very beginning of the path. But when it error on something (for Rails 3.0), the path says: [Error message] c:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb why is it 1.9.1 gems path for Ruby 1.9.2? 回答1: From a little FAQ chapter to the release: The standard library is installed in /usr/local/lib/ruby/1.9.1 This version number is "library

How to check the compatible Ruby versions for a gem

◇◆丶佛笑我妖孽 提交于 2020-01-11 11:29:06
问题 How do I find out if a particular gem is compatible with a certain Ruby version or not? I want to upgrade the Ruby version of an application I am working on, But I did not see an authentic way of knowing which Ruby version is supported by a particular gem. I found the *.gemspec of the gem, which often contains a configuration saying config.required_ruby_version ... , but I noticed not all the gems contain a gemspec file. I noticed I have a few gems on my system, ActiveRecord for example,

Can the merit gem recalculate reputation and re-evaluate badges and ranks?

故事扮演 提交于 2020-01-11 05:44:09
问题 I would like to add a system of points, ranks and badges in my rails app. The merit gem looks cool, but I want to make sure how it works before using it. The way you define badges # app/models/merit/badge_rules.rb grant_on 'comments#vote', :badge => 'relevant-commenter', :to => :user do |comment| comment.votes.count == 5 end and points # app/models/merit/point_rules.rb score 10, :to => :post_creator, :on => 'comments#create' do |comment| comment.title.present? end suggest that the action is