Shoes and Gems

2019-04-11 16:36发布

Code:

Shoes.setup do
  gem 'mechanize'
end

require 'rubygems'
require 'mechanize'

Running Shoes on it says:

no such file to load -- mechanize

Thank you.

标签: ruby shoes
2条回答
干净又极端
2楼-- · 2019-04-11 16:54

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.

查看更多
淡お忘
3楼-- · 2019-04-11 16:54

rubygems needs to be required before any gems.

require 'rubygems'
require 'mechanize'

Shoes.setup do
  gem 'mechanize'
end
查看更多
登录 后发表回答