gem

ruby+gem常用命令

寵の児 提交于 2019-12-21 19:58:57
ruby -v #查看ruby 版本 ruby -e ''require"watir"; puts Watir::IE::VERSION'' #查看watir版本 gem -v #gem版本 gem update #更新所有包 gem update --system #更新RubyGems软件 gem install rake #安装rake,从本地或远程服务器 gem install rake --remote #安装rake,从远程服务器 gem install watir -v(或者--version) 1.6.2#指定安装版本的 gem uninstall rake #卸载rake包 gem list d #列出本地以d打头的包 gem query -n ''[0-9]'' --local #查找本地含有数字的包 gem search log --both #从本地和远程服务器上查找含有log字符串的包 gem search log --remoter #只从远程服务器上查找含有log字符串的包 gem search -r log #只从远程服务器上查找含有log字符串的包 gem help #提醒式的帮助 gem help install #列出install命令 帮助 gem help examples #列出gem命令使用一些例子 gem build rake

gem install XYZ locally (without connection to the internet)

℡╲_俬逩灬. 提交于 2019-12-21 18:05:12
问题 I need to install win32-api and antlr3 on a computer without internet connection. Had it such a connection, I'd use gem like so: gem install win32-api -r gem install antlr3 -r This won't obviously work. So, I thought there should be a way to download the gem and install it later, but I am not sure how I would proceed. I found gem's which operator, which seemd to indicate the local location of a gem: c:\>gem which antlr3 c:/tools/Ruby187/lib/ruby/gems/1.8/gems/antlr3-1.8.8/lib/antlr3.rb

Error when run “gem install rails”

寵の児 提交于 2019-12-21 17:49:18
问题 My configuration: Operating System: Ubuntu 12.04 rvm version: 1.25.14 ruby version: 2.1.0p0 gem version: 2.2.1 $ which ruby /home/tauhidul35/.rvm/rubies/ruby-2.1.0/bin/ruby $ which rvm /home/tauhidul35/.rvm/bin/rvm $ which gem /home/tauhidul35/.rvm/rubies/ruby-2.1.0/bin/gem $ which bundle /home/tauhidul35/.rvm/gems/ruby-2.1.0@global/bin/bundle Now when I run command, I get error: $ gem install rails ERROR: While executing gem ... (NoMethodError) undefined method `ord' for nil:NilClass If I

Error installing gems: cannot load such file — zlib

拈花ヽ惹草 提交于 2019-12-21 12:35:14
问题 I'm trying to install bundler gem on Mac OS Yosmite ~/code/hello gem install bundler ERROR: Loading command: install (LoadError) cannot load such file -- zlib ERROR: While executing gem ... (NoMethodError) undefined method `invoke_with_build_args' for nil:NilClass I've done the following: Install zlib through homebrew Upgrade Rubygems Reinstall RVM and Ruby 2.2.2 Switched to Rbenv and Ruby 2.2.2 This is really doing my head in. Ruby 2.2.1 works fine but 2.2.2 causes this issue whenever I try

How do I install the mysql ruby gem under OS X 10.5.4

China☆狼群 提交于 2019-12-21 12:15:06
问题 Here is the deal. $ gem --version 1.1.0 $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config Bulk updating Gem source index for: http://gems.rubyforge.org/ ERROR: could not find mysql locally or in a repository $ sudo gem update Updating installed gems Bulk updating Gem source index for: http://gems.rubyforge.org/ Updating RedCloth ERROR: While executing gem ... (Gem::GemNotFoundException) could not find RedCloth locally or in a repository I've tried this, this,

'bundle exec' complains about gem not being installed, even after 'bundle install'

℡╲_俬逩灬. 提交于 2019-12-21 11:35:27
问题 I have a website using Jekyll with Github Pages. After previously messing about with versions and RVM on another computer, on this one I opted to stick with just one version of Ruby and per-project environments using bundler. I have a pretty simple Gemfile : [$]> cat Gemfile source 'https://rubygems.org' gem 'github-pages' and bundler config: [$]> cat .bundle/config --- BUNDLE_PATH: env BUNDLE_DISABLE_SHARED_GEMS: '1' When I run any command (jekyll, gem, irb) through bundle exec , I get a

Ruby - create gem: reload console with updated gem content

。_饼干妹妹 提交于 2019-12-21 09:22:14
问题 According to this article, we can test around our gem code by adding those lines to our rakefile: task :console do require 'irb' require 'irb/completion' require 'my_gem' # You know what to do. ARGV.clear IRB.start end It works really well, except that whenever a change is made to the gem, I need to exit and rerun rake console to get the code updated. It is really not convenient as a creation/debugging tool ... Is there a way to write a custom method that would act as the awesome reload!

Can't install ZenTest 4.8.4

◇◆丶佛笑我妖孽 提交于 2019-12-21 08:18:23
问题 When I try to install ZenTest: gem install ZenTest I get the following error: Invalid gemspec in [C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement ["< 2.1, >= 1.8"] I tried cleaning up the gems and removing the ZenTest to no avail. What's wrong? 回答1: I've just spoken with Ryan Davis, the author of ZenTest. He tells me that this is due to a bug in RubyGems and they're preparing a release that fixes it. In the meantime, downgrade to 4

Password encryption problem in Rails Devise gem

最后都变了- 提交于 2019-12-21 06:19:22
问题 I am now currently changed to use the Gem Devise for user authentication. But I don't know how to match the encryption! I knew that we could write a new encryptor and assign it in initializers, but the point is the encryptor accepts 4 arguments only (password, stretches, salt, pepper). But in my case, I do included the user's email and a customized salt in the encryption. Is it possible to pass the user's email and customized salt into the encryptor? ps. I am using database_authenticatable

cannot load such file — libxml_ruby for Windows

喜你入骨 提交于 2019-12-21 05:14:27
问题 My step is, Execute RubyInstaller.exe file install ruby installed Path: c:\ruby193 install DevKit gem install libxml-ruby --platform x86-mswin32-60 make test.rb file require 'rubygems' require 'xml' ruby test.rb print error msg Error message: C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 126: The specified module could not be found - C:/Ruby193/lib/ruby/gems/1.9.1/gems/lib xml-ruby-1.1.3-x86-mswin32-60/lib/libxml_ruby.so (LoadError) from C:/Ruby193/lib/ruby