简体   繁体   中英

Trouble running httparty in rails 4.0 with ruby 2.0

To include httparty in my rails 4.0.0 app, in my gemfile I wrote:

gem 'httparty'

and then ran bundle install

Next in my application.rb file, I inserted this:

module myApp
  class Application < Rails::Application
    ### ---
    config.gem "httparty"
    ### ---
end

Now when I load rails c and do a require "httparty" , I get false

What am I doing wrong? How do I load httparty in my rails app?

It's already loaded by Rails. You also don't need the config.gem in application.rb

Try using HTTParty from the console. It should just work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM