rubygems

Installing Rails 4.2.0.beta1 - Unresolved dependency found during sorting

ぐ巨炮叔叔 提交于 2019-12-22 04:48:10
问题 I've attempted to install Rails 4.2.0.beta1 (released Aug 20, 2014). I get an error "Unresolved dependency found during sorting." Here are the details: $ ruby -v ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] $ gem -v 2.4.1 $ gem install rails --pre ERROR: While executing gem ... (Gem::DependencyError) Unresolved dependency found during sorting - activesupport (>= 4.0) (requested by sprockets-rails-3.0.0.beta1) How can I install Rails 4.2.0.beta1? 回答1: This issue has been fixed

Missing the Rails 2.3.4 gem. Even though it's installed!

我怕爱的太早我们不能终老 提交于 2019-12-22 04:42:17
问题 Running Snow Leopard. Tried uninstalling, and re-installing. Still getting the same error whenever I run a rake task. mbpro:redmine shereef$ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0] mbpro:redmine shereef$ rails -v Rails 2.3.4 mbpro:redmine shereef$ which rails /usr/local/bin/rails mbpro:redmine shereef$ gem -v 1.3.5 mbpro:redmine shereef$ which gem /usr/local/bin/gem mbpro:redmine shereef$ rake -v (in /Users/shereef/Documents/Code/BetterMeans/redmine) Missing the

Ssetting up rspec2 task in Rakefile

蓝咒 提交于 2019-12-22 04:33:26
问题 I have a Rakefile that looks like this: require 'rspec/core/rake_task' desc "Run all RSpec tests" RSpec::Core::RakeTask.new(:spec) This isn't working though. For example, if I try to run "rake -T", I get: code/projects/bellybuster[master]% rake -T --trace (in /Users/craig/code/projects/bellybuster) rake aborted! no such file to load -- rspec/core/rake_task /Users/craig/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /Users/craig/.rvm/rubies/ruby

Is there a way to call ruby1.9 without loading rubygems?

淺唱寂寞╮ 提交于 2019-12-22 04:33:16
问题 So ruby 1.9 is really nice in that it'll automatically require rubygems, and hence when you call require 'somegem' without first requiring rubygems it'll work, and that's generally awesome. But I have a ton of shell scripts using ruby, and they generally don't rely on rubygems. Shell tools should run instantly, and loading rubygems for nothing is a major drag, mostly because it involves a bunch of disk operations with scattered small files. I want to be able to tell ruby, when running these

why do i keep getting these errors after running “gem pristine --all”

对着背影说爱祢 提交于 2019-12-22 04:25:11
问题 I try to run gem pristine --all and i keep getting this in the console. when i run gem pristine --all i get this: Permission denied .... I even tried to do gem install for every gem and still get this: Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2 Ignoring byebug-5.0.0 because its extensions are not built. Try: gem pristine byebug --version 5.0.0 Ignoring debug_inspector-0.0.2 because its extensions are not built.

Problem Supporting two way syntax in ruby

落花浮王杯 提交于 2019-12-22 04:02:27
问题 I have a situation where i need to call something like this : class Office attr_accessor :workers, :id def initialize @workers = [] end def workers worker type = worker.type resp = Worker.post("/office/#{@id}/workers.json", :worker => {:type => type}) worker = Worker.new() resp.to_hash.each_pair do |k,v| worker.send("#{k}=",v) if worker.respond_to?(k) end self.workers << worker end end Worker class class Worker attr_accessor :office_id, :type, :id def initialize(options={}) @office_id =

How to rescue from a require “gem_name” when the gem is not installed

独自空忆成欢 提交于 2019-12-22 03:24:22
问题 I'm writing a library that depend on a specific gem. I require the gem and use it in my code and everything is hunky-dory as long as the gem is installed on the user's machine. but what if it is not?! I thought it's fine cause I can rescue from the require command and print a message to the output to inform the user about the lacking gem and finish it gracefully but I get an error! Could you tell me how it should be done or what is wrong with this piece of code: begin require "some_gem"

ActiveAdmin actions

做~自己de王妃 提交于 2019-12-22 01:34:03
问题 is there a way to specify in ActiveAdmin's index page of a model what actions are allowed, things like: index do actions :edit end index do actions only: :edit end do not work. What's the correct syntax? Appreciated. bundle show activeadmin /home/muichkine/.rvm/gems/ruby-2.1.2/bundler/gems/active_admin-9cfc45330e5a 回答1: Add whatever actions you want to be available by using actions (it is usually put under model definition): ActiveAdmin.register YourModel do actions :index, :show, :create,

Rails - gem install mysql doesn't work on cygwin

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 00:17:39
问题 I tried to do gem install mysql but there is an error. "Could not create Makefile due to some reason..." How do I fix this? I believe I installed mysql on cygwin. Help!! 回答1: gem install mysql --platform x86-mingw32 works in cygwin 回答2: First, download the MySQL source code - you'll want the same version as whatever MySQL version you already have running (I'm using 5.1.42, which is the current binary from the MySQL Web site, but select whatever you need here: MySQL Snapshots) Second, find a

Rails 3: Permalink public profile

旧城冷巷雨未停 提交于 2019-12-21 21:31:23
问题 I have /users/1 as the public user profile (show method) but I'd like to have /user_name instead of /users/1 . Can I accomplish that if I use devise? Thanks Edit: My show controller: # public profile page def show @user = User.find(params[:id]) end 回答1: Get username into URL You can do it. Devise is just an authentication solution. Your other controllers can behave however you want them to. Here is an overview of the steps that you need to get this URL behavior. Ensure that user_name is