开发者

Should I add files that are part of the Ruby Standard Library to the `Gemfile`?

开发者 https://www.devze.com 2023-02-06 02:57 出处:网络
I need to do require \'openssl\' in my code. Otherwise, I get NameError: uninitialized constant Object::OpenSSL. But, when I do gem list, I don\'t see openssl. I\'m deploying a Sinatra app to Heroku s

I need to do require 'openssl' in my code. Otherwise, I get NameError: uninitialized constant Object::OpenSSL. But, when I do gem list, I don't see openssl. I'm deploying a Sinatra app to Heroku stack bamboo-mri-1.9.2. Should I add openssl to the Gemfile? I don't think so because开发者_Go百科 I think openssl is part of the Ruby Standard Library. Also, what about base64?


You do not need to include gems in the Gemfile that are in the Ruby Standard Library for the versions of Ruby you support.

You can have your program auto-require all gems in Gemfile. Rails does this. Otherwise, just require 'gem_name' in the files that require it.


It's very likely that you have compiled ruby without openssl support. If you are using RVM, you can try this

0

精彩评论

暂无评论...
验证码 换一张
取 消