gem

best practices for transfering ruby gems collection from one machine to another

走远了吗. 提交于 2019-12-08 10:10:20
问题 i want to copy all of my gems from one machine (foo) to another (bar). both machines are identical except that foo has a bunch of gems installed and bar does not (bar cannot get onto the internet). i copied /usr/local/lib/ruby/gems from foo to bar, and now bar recognizes that the gems are installed. root@bar # gem list *** LOCAL GEMS *** keybox (1.2.1) rake (0.9.2.2) ... and so on if i try to run them from their native location, they work as expected root@bar # cd /usr/local/lib/ruby/gems/1.8

Automatically concatenating files using Watchr

穿精又带淫゛_ 提交于 2019-12-08 10:02:40
问题 I have a bunch of JS files that I split up, but want to concatenate automatically (so I don't define a bunch of files in HTML). Right now, I copied the command from Twitter Bootstrap. Makefile: scripts: cat scripts/*.js > public/scripts/scripts.js watchScripts: watchr -e "watch('scripts/.*\.js') {system 'make scripts'}" However, I've found watchr to be very inconsistent (on Mac OS X 10.8) Sometimes when I save a js file, it doesn't run make scripts . Other times, it does. One time, it just

A notification system to track user activity on Rails

孤者浪人 提交于 2019-12-08 08:45:31
问题 I'm working on a gem that would generate notifications based on event triggers. For Example, in a CMS, if an article is created, a notification "Article x created by user y" would be generated. (like Github/Facebook notifications). In my gem, I have a has_notifications method which when specified in a model, registers callbacks. The problem, of course is, when the callback is triggered, a corresponding action within the gem is invoked, but this action would require the user id of the user who

Ruby gem names with appended ruby version

做~自己de王妃 提交于 2019-12-08 08:32:04
问题 Ruby gem names are really throwing me off. For example if install a gem called jade, a wrapper script is placed at /usr/bin/jade1.9 on some systems and at /usr/bin/jade on others. I'm curious if anyone has a recommendation on how I can use jade in scripts without writing some hackish code that guesses the correct gem name. The naming also makes it difficult to write documentation for less savvy users. Is there a simple way of making gems install with same name on all systems? To elaborate a

Error while installing rails `$ gem install rails`

江枫思渺然 提交于 2019-12-08 07:56:16
问题 Hi I am new to Ruby on Rails and trying to setup in my machine [Ububntu 12.04 LTS]. I successfully installed Ruby and Gem now I am getting error while installing Rails Here is my version of Ruby and Gem $ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] $ gem -v 2.1.7 Now when I try command $ sudo gem install rails or $ gem install rails ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL

How to install syck 1.0.1 on Ubuntu 15.04?

拜拜、爱过 提交于 2019-12-08 07:33:44
问题 I'm getting an error installing syck on Ubuntu 15.04. Building the native extensions fails: Installing syck 1.0.1 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. /home/markus/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150618-8242-1z0c5iw.rb extconf.rb checking for st.h... yes creating Makefile make "DESTDIR=" clean make "DESTDIR=" compiling bytecode.c compiling implicit.c compiling token.c token.re: In function ‘sycklex_yaml_utf8’: token.re:541:36

On rapns, how can I know the token for unregistered GCM devices so I can remove them from my database?

时光毁灭记忆、已成空白 提交于 2019-12-08 07:17:28
问题 I am using rapns to provide GCM and APNS support. For APNS, I know what unregistered device I must delete via on.apns_feedback (rapns.rb): on.apns_feedback do |feedback| device = AppleDevice.find_by_token(feedback.device_token) device.destroy if device end but for GCM, I can't find a way to know what device is unregistered so I can delete it from my database. I tried with the reflection API, but I'm not getting on.notification_failed and on.error called whenever a Rapns::DeliveryError

Geos installation in non-standard location

孤街浪徒 提交于 2019-12-08 07:15:29
I'm running on nitrous.io and trying to install the rgeo gem using ruby 2.0.0-p353. I don't have sudo access, so I tried to compile and install geos from source. Once I downloaded and untarred the source files, I cd into the source folder and run mkdir /home/action/local && ./configure --prefix=/home/action/local make && make install This runs for a bit. I then run gem install rgeo -- --with-geos-dir=/home/action/local Things look alright, but if I hop into a terminal I get RGeo::Geos.supported? > false Looking back over the mkmf.log file, I see these lines: /usr/bin/ld: cannot find -lgeos

SSL Error During Gem Installation (on MinGW64-MSys2)

谁说我不能喝 提交于 2019-12-08 06:24:01
问题 I'm using a MinGW64-MSys2 environment. When I try to install a package with gem install <package name> I get something like this SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/latest_specs.4.8.gz) 回答1: Depends on what shell you use msys or mingw* and what ruby you use you need install ca-certificates package: pacman -S mingw-w64-i686-ca-certificates or pacman -S mingw-w64-x86_64-ca-certificates or pacman -S ca

rake install fails but gem install works fine, any idea why?

╄→尐↘猪︶ㄣ 提交于 2019-12-08 06:19:14
问题 The problem: I have this gem that I am working on. While trying to install it locally to do some tests, rake install fails after building the gem. Rake suggested that I run gem install for the built gem to debug. Surprisingly, gem install pkg/my_gem-x.y.z.gem works like a charm! Any idea why? Some details: rake version: 10.0.3 Gem created using bundler version: 1.2.1 Contents of gemspec: lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require