gem

Getting remove_entry_secure error while using ruby application

女生的网名这么多〃 提交于 2019-12-21 01:17:35
问题 I am trying to split PDF files into images using docsplit. But it appears I have issues with my ruby installation. I keep getting the following error every time: /usr/lib/ruby/1.8/fileutils.rb:694:in `remove_entry_secure': parent directory is world writable Here is the full command line output: $ docsplit images pdf-test.pdf /usr/lib/ruby/1.8/fileutils.rb:694:in `remove_entry_secure': parent directory is world writable, FileUtils#remove_entry_secure does not work; abort: "/tmp/d20130207-6739

How to refer a local gem in ruby?

一曲冷凌霜 提交于 2019-12-20 23:23:58
问题 I pack some ruby code into a gem. I want to refer the code in the gem in some other code. So in the Gemfile I specify the gem's name, version, and local path. Like: gem 'gemname','0.x', :path => 'RELATIVE_PATH_TO_GEM_FILE' After bundle install, I see Using gemname (0.x) from source at RELATIVE_PATH_TO_GEM_FILE But when I run the code, it can't find the code in the gem. LOAD_PATH shows ABSOLUTE_PATH_TO_GEM_FILE/lib. No wonder it can't find the code, there's only gem file under ABSOLUTE_PATH_TO

First ever bundle install, stack level too deep

天涯浪子 提交于 2019-12-20 19:42:24
问题 I have created a brand new rails project using the command rails new qbc --database=mysql . It creates all the files perfectly fine, but at the bundle install it errors out $ bundle install Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! /usr/bin/bundle:23: stack level too deep (SystemStackError)

Is it possible to download a Ruby gem without installing it automatically?

北城以北 提交于 2019-12-20 17:38:25
问题 When I download something using gem I'd like to be able to just download the gem, and then choose whether or not I want to install it. I'm asking this because I'd like to install a particular gem on more than one computers ( without installing from the internet on each one ). 回答1: gem fetch So, something like $ gem fetch gosu ... this will leave gosu-0.7.14.gem in the current directory. This will work even if you have already installed it. 回答2: Most of the gems are hosted on github.com right

Can I run a Rails engine's specs from a real app which mounts it?

妖精的绣舞 提交于 2019-12-20 12:37:08
问题 I have a Rails Engine meant to provide some models and controllers to a larger project of ours. There's a pretty decent set of specs for the Engine, using a bunch of mocks and some full-scale models and controllers within the engine's dummy app to make sure the Engine is doing what it's supposed to and working with the larger application. However, even with all tests passing, I frequently find broken behavior when I update the engine in the larger application. If my tests are passing but the

Gemfile.lock Use in Rails?

纵饮孤独 提交于 2019-12-20 11:14:03
问题 What is the purpose of "Gemfile.lock" in Rails? I have been searching around for but could not find a satisfactory answer. 回答1: You should read all the documentation from the bundler gem: http://gembundler.com/ THE GEMFILE.LOCK When you run bundle install, Bundler will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock. Bundler uses this file in all subsequent calls to bundle install,

Multitenant Architecture in Ruby on Rails [closed]

爷,独闯天下 提交于 2019-12-20 11:09:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Please let me know the best books available for Implementing Multitenant Architecture in Ruby on Rails. Is there any gem or framework available for same? 回答1: There are no books just yet, but there's an interesting talk on the subject http://aac2009.confreaks.com/06-feb-2009-14-30-writing-multi-tenant

Ruby gems in stand-alone ruby scripts

眉间皱痕 提交于 2019-12-20 10:34:14
问题 This is a really basic ruby gems question. I'm familiar with writing simple ruby scripts like this: #!/usr/bin/ruby require 'time' t = Time.at(123) puts t Now I'd like to use my own ruby gem in my script. In my rails project I can simply require 'my_gem' . However this doesn't work in a stand-alone script. What's the best/proper way to use my own gem in a stand-alone ruby script? 回答1: You should be able to simply require it directly in recent versions of Ruby. # optional, also allows you to

How to check if a gem is installed?

半城伤御伤魂 提交于 2019-12-20 09:29:30
问题 I installed data_mapper for a Sinatra project. Curious, why is it when I do gem install brew , I can $ which brew and get the path of its location and can't for data_mapper? This works for some gems and doesn't for others. How do I verify a gem is installed properly? Would checking the version assure the gem is downloaded correctly? 回答1: General solution Try gem list to get the list of gems that are installed. To test for a particular gem, you can use -i with a regex: gem list -i "^gem_name$"

Developing gems and testing

自古美人都是妖i 提交于 2019-12-20 09:17:04
问题 I am new to developing Ruby gems, but I thought I'd give it a try. Recently checking out the latest episode on Railscasts (http://railscasts.com/episodes/245-new-gem-with-bundler) I'm using Bundler to create my gem. However I'm kind of clueless on how to test my gem. Sure I could run rake install and then require it from irb , but this seems like a kind of slow workflow for me. What I'd like to do is create a dummy Rails app and require the gem by referencing to it's source code. Is this