1

While trying to run a rails app, I am getting the following error

rails s -p 5000
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: already initialized constant Net::SMTPSession
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/smtp.rb:806: warning: previous definition of SMTPSession was here
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: already initialized constant Net::POP
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:687: warning: previous definition of POP was here
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: already initialized constant Net::POPSession
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:688: warning: previous definition of POPSession was here
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:689: warning: already initialized constant Net::POP3Session
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:689: warning: previous definition of POP3Session was here
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: already initialized constant Net::APOPSession
    /home/user/.rvm/gems/ruby-2.1.6/gems/tlsmail-0.0.1/lib/net/pop.rb:702: warning: previous definition of APOPSession was here
    /home/user/.rvm/gems/ruby-2.1.6/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'activeadmin'. (Bundler::GemRequireError)

What causes a Gem Require error in bundler?

3 Answers3

0

It seems like you have multiple versions of the gem tlsmail being installed/loaded. That is the reason, you get the warning of it being already initialized. What you can do is run:

 gem list --local | grep 'tlsmail'

which will return a list of versions of the gem installed. Then you can remove one of the versions (as per the dependency of your project) and see if that works.

gem uninstall tlsmail -v <version> 

You might also want to check, whether you have same gem with different versions in the Gemfile.

Hope that helps!

Jeremy Rajan
  • 662
  • 3
  • 12
0

I hope its trying to load activeadmin

May be the problem in activeadmin

check the gemfile and installation

  gem 'activeadmin'

Use this to install activeadmin : Active admin install with Rails 4

Community
  • 1
  • 1
Kanna
  • 990
  • 1
  • 11
  • 30
0

Did you initialize your gemset? (Because you're using RVM)

Initialize your gemset as follows before running server,

rvm use ruby-2.3.0@rails425

replace the version of ruby and the name of gemset with your version of ruby and name of gemset.

Bangash
  • 1,152
  • 3
  • 10
  • 30