rubygems

Using a gem without installing it

断了今生、忘了曾经 提交于 2020-01-02 02:10:06
问题 I need to run a bunch of ruby scripts that I have written on a server that I don't have sudo access to. On my own machine, I have installed a bunch of gems using 'sudo gem install ..' and used them in my code.. Is there any mechanism which would let me use these gems without formally installing them on a remote machine? 回答1: You can install them in a user directory: http://docs.rubygems.org/read/chapter/3#page83 This looks like it lets you install the gems anywhere you want. 回答2: You can, but

Why is it “wrong to require rubygems”?

我只是一个虾纸丫 提交于 2020-01-02 01:19:09
问题 According to this post, requiring rubygems is an antipattern. require 'rubygems' The argument seems to boil down to this: When I use your library, deploy your app, or run your tests I may not want to use rubygems. When you require 'rubygems' in your code, you remove my ability to make that decision. I cannot unrequire rubygems, but you can not require it in the first place. But couldn't the same argument be made about any Ruby library that you 'require' when you create and share a library of

Rspec Testing of real time results through mTurk

删除回忆录丶 提交于 2020-01-02 01:00:10
问题 I am creating hits at mTurk through Rspec test code but at the same time i need to test the results which must be send back from mTurk. In order to save complexity testing for every test i'm using VCR to record the HTTP Requests in a cassette. How can i implement this test?? 回答1: well i did some hack for that, i used debugger to hold my rspec test until results comes back from mTurk and then it get stored in VCR. so i have to do this kinda hack once and then after that VCR works for me 来源:

Using bundler inside my gem

空扰寡人 提交于 2020-01-01 19:34:09
问题 I wanted to use bundler inside gem I wrote. I had Gemfile and in my_gem_file.rb I have require 'rubygems' require 'bundler' Bundler.setup Bundler.require(:default) But when I build and install my gem I get exception Bundler::GemfileNotFound: Could not locate Gemfile. Is there any solution for using bundler inside gems? 回答1: Since your gem has specified its dependencies in its .gemspec you can assume that they will be available at runtime. Don't involve Bundler. You can, however, still make

Ruby on Rails Win7 x64?

时光总嘲笑我的痴心妄想 提交于 2020-01-01 19:31:28
问题 I've just upgraded to Win7 x64 Professional and wanted to recommence developing my Rails Apps, however I'm getting the following error : => Booting Mongrel => Rails 2.3.5 application starting on http://127.0.0.1:3344 D:/nu codes/R/ruby-1.8.7-p174-i386-mswin32/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:271:in `require_frameworks': 193: %1 is not a valid Win32 application. - D:/nu codes/R/ruby-1.8.7-p174-i386-mswin32/lib/ruby/1.8/i386-mswin32/openssl.so (RuntimeError) from D:/nu

Trouble installing gitlab-5.0. I can't finish the installation

天涯浪子 提交于 2020-01-01 18:27:41
问题 I am installing gitlab-5.0 on Ubuntu 10, when I execute the 'sudo gem install bundler' command on section Ruby of the gitlab installation guide, It shows me the next conflict: root@ubuntu:/home/gitlab/gitlab# sudo gem install bundler Successfully installed bundler-1.3.4 Installing ri documentation for bundler-1.3.4 /usr/lib/ruby/1.8/rdoc/rdoc.rb:280: warning: conflicting chdir during another chdir block /usr/lib/ruby/1.8/rdoc/rdoc.rb:287: warning: conflicting chdir during another chdir block

How can I install Jekyll on Ubuntu 10.04 Server?

此生再无相见时 提交于 2020-01-01 11:47:32
问题 The definitive guide to installing Jekyll seems to be https://github.com/jekyll/jekyll where it says: gem install jekyll I am getting an ERROR: could not find gem jekyll locally or in a repository regardless of whether I run that command as superuser or not. gem env Returns the following: RubyGems Environment: - RUBYGEMS VERSION: 1.2.0 - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] - INSTALLATION DIRECTORY: /var/lib/gems/1.8 - RUBY EXECUTABLE: /usr/bin/ruby1.8 - EXECUTABLE

Changing the reading order of Rubygem sources

谁说我不能喝 提交于 2020-01-01 11:33:10
问题 I have created a private gem that I have hosted myself. Everything was going well up until someone has created a gem with the same name on rubygems.org. Since rubygems.org has a highest precedence over my gem server url. I am not able to install my gem anymore. I tried to remove the rubygems source: $ sudo gem source -r http://rubygems.org and reinstall it so it comes after in the gem source list, but it does not work. Is there a way to change the lookup order of the gem source? Note that I

Rails, Ruby 1.9.3p0, and mysql gem

你离开我真会死。 提交于 2020-01-01 09:24:23
问题 I'm running CentOS6 and installed Ruby from source, along with Rails and some other staff. ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] rails -v Rails 3.1.3 Some gems: *** LOCAL GEMS *** actionmailer (3.1.3, 2.3.14) actionpack (3.1.3, 2.3.14) activemodel (3.1.3) activerecord (3.1.3, 2.3.14) activeresource (3.1.3, 2.3.14) activesupport (3.1.3, 2.3.14) archive-tar-minitar (0.5.2) arel (2.2.1) bigdecimal (1.1.0) bouncy-castle-java (1.5.0146.1) builder (3.0.0) bundler (1.0.21)

Devise 'translation missing' error with subclassed controller

橙三吉。 提交于 2020-01-01 08:40:12
问题 I've subclassed Devise::RegistrationsController . The subclassed controller, in my case, is AdminRegistrationsController . But, when I sign up a new admin, for example, the flash shows the message: translation missing: en.devise.admin_registrations.admin.signed_up I've verified an entry exists in config/locales/devise.en.yml . Here's the snippet: en: devise: registrations: signed_up: 'Welcome! You have signed up successfully.' What am I missing? 回答1: You must do this : en: devise: admin