Shoes and Gems

耗尽温柔 提交于 2019-12-21 20:44:02

问题


Code:

Shoes.setup do
  gem 'mechanize'
end

require 'rubygems'
require 'mechanize'

Running Shoes on it says:

no such file to load -- mechanize

Thank you.


回答1:


I did:

sudo gem install mechanize

and the following seems to be working:

Shoes.setup do
  gem 'mechanize'
end

require 'mechanize'

It says 'Building native extensions' and is taking forever, but seems to be the norm according to hackety.org.




回答2:


rubygems needs to be required before any gems.

require 'rubygems'
require 'mechanize'

Shoes.setup do
  gem 'mechanize'
end


来源:https://stackoverflow.com/questions/548657/shoes-and-gems

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!