rubygems

Rails Tutorial: nokogiri-1.5.2 error on bundle install

坚强是说给别人听的谎言 提交于 2019-12-20 10:33:45
问题 After working through the RVM setup, rspec and guard sections of chapter 3 of the Ruby on Rails Tutorial, whenever I run bundle install I get the following error dump: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError) from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from extconf.rb:5:in `<main>' Gem files

Ruby/Rails - Remove ActiveAdmin from my application

ⅰ亾dé卋堺 提交于 2019-12-20 09:50:51
问题 I had a good time playing with Active Admin the administrative framework within my application. http://activeadmin.info/ When I installed it I ran rails g active_admin:install rake db:migrate rails g active_admin:resource product and it generated alot of migrations and code within my application. My question if I would like to go back and have everything that active_admin put into my application taken out, how would i do so? Is there one 'rails active_admin:uninstall' command to get rid of

Determine Location Of Ruby Gems

感情迁移 提交于 2019-12-20 09:39:08
问题 How do I determine the location of my ruby gems? 回答1: you can try gem which rails to fetch location for particular gem, or echo $GEM_HOME to fetch home dir of your gems 回答2: gem environment ...should give you all the info you need. 回答3: With budler you can do: bundle show <gem> Reference: http://bundler.io/v1.1/bundle_show.html 来源: https://stackoverflow.com/questions/11109279/determine-location-of-ruby-gems

How to stop the 'gem' utility from accessing my home directory?

不羁岁月 提交于 2019-12-20 09:17:47
问题 When I run gem install <somegem> command the gem utility tries to access my home directory. It contains some non-latin characters and installation fails because of that. For example: E:\ruby\bin>gem install <somegem> ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - C:\Documents and Settings\<user> If I switch to another user account with a username containing ASCII characters only gem works fine. Does anybody know how to tell gem NOT to check my home directory?

After upgrading to macOS Mojave gem update is failing

社会主义新天地 提交于 2019-12-20 08:59:47
问题 Building native extensions. This could take a while... ERROR: Error installing libxml-ruby: ERROR: Failed to build gem native extension. current directory: /Library/Ruby/Gems/2.3.0/gems/libxml-ruby-3.1.0/ext/libxml /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180926-80978-eoqfjh.rb extconf.rb checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... no *** extconf.rb failed ***

Rails 3: Generate unique codes (coupons)

核能气质少年 提交于 2019-12-20 08:30:13
问题 What's the best way to generate unique codes to use as coupon codes? Thanks. 回答1: You can do something like this too: chars = ('a'..'z').to_a + ('A'..'Z').to_a def String.random_alphanumeric(size=16) (0...size).collect { chars[Kernel.rand(chars.length)] }.join end But then you would have to compare against a database to make sure it is not used yet. 回答2: In Ruby's standard library there is SecureRandom for this: SecureRandom.hex(3) The length of the output is double of what the length input

RVM Warning! PATH is not properly set up

我只是一个虾纸丫 提交于 2019-12-20 08:27:42
问题 I just installed rvm on my mac, but I receive this warning on global commands Warning! PATH is not properly set up, '/usr/local/rvm/gems/ruby-1.9.3-p194/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p194'. My $PATHS confirms the warning: $echo :$PATH: :/usr/local/rvm/bin:

Writing a Ruby extension in Go (golang)

旧巷老猫 提交于 2019-12-20 08:26:15
问题 Are there some tutorials or practical lessons on how to write an extension for Ruby in Go? 回答1: Go 1.5 added support for building shared libraries that are callable from C (and thus from Ruby via FFI). This makes the process easier than in pre-1.5 releases (when it was necessary to write the C glue layer), and the Go runtime is now usable, making this actually useful in real life (goroutines and memory allocations were not possible before, as they require the Go runtime, which was not useable

Download all gems dependencies

我只是一个虾纸丫 提交于 2019-12-20 08:18:12
问题 I want to install compass by downloading any required file and taking them to another machine without internet connection . I have downloaded the source package for compass and when I run gem on it in the non connected machine it complains about missing dependencies. Any solution? 回答1: Thats exactly the problem I had. After searching around a while I found a Solution who works using Bundler https://bundler.io/ Getting Gem with Dependencies: Create a new Folder with a File named Gemfile in it.

Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

夙愿已清 提交于 2019-12-20 08:03:31
问题 I'm attempting to install jekyll and I've encountered an error. I'm running Mac OS X 10.11.4 (El Capitan). $gem install jekyll ERROR : While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources $gem source -l https://ruby.taobao.org $which openssl /usr/local/bin/openssl I welcome your suggestions how to resolve this error. 回答1: Newer versions of OSX deprecated openSSL, leaving many dependencies broken. You need to