John
John

Reputation: 1323

getting an error while trying to create a new rails application

When i am trying to create a new rails application by using rails new recaptcha command, then i am getting the following error.

john@john-OptiPlex-390:~/proj$ rails new recaptcha
/home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:2274:in `check_version_conflict': can't activate activesupport-5.0.6, already activated activesupport-5.0.4 (Gem::LoadError)
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:1403:in `activate'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:89:in `block in require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:88:in `each'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:88:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/concurrent-ruby-1.0.5/lib/concurrent.rb:15:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.4/lib/active_support/logger_silence.rb:3:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.4/lib/active_support/logger.rb:1:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.4/lib/active_support.rb:27:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/railties-5.0.4/lib/rails/generators.rb:6:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/railties-5.0.4/lib/rails/commands/application.rb:1:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/railties-5.0.4/lib/rails/cli.rb:14:in `<top (required)>'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
    from /home/john/.rvm/gems/ruby-2.3.1/gems/railties-5.0.4/exe/rails:9:in `<top (required)>'
    from /home/john/.rvm/gems/ruby-2.3.1/bin/rails:23:in `load'
    from /home/john/.rvm/gems/ruby-2.3.1/bin/rails:23:in `<main>'
    from /home/john/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /home/john/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
john@john-OptiPlex-390:~/proj$ 

Can some one help me to fix this issue.

Upvotes: 0

Views: 108

Answers (3)

Muhammad Usman
Muhammad Usman

Reputation: 21

you can use

bundle install --pre

then

gem update rails

Thanks

Upvotes: 0

Surender Thillainathan
Surender Thillainathan

Reputation: 716

It seems the command is trying to load multiple rails dependencies while creating the application.

You can resolve this by

$ gem update rails

Or

$ gem update --system

Upvotes: 1

Adrian Rotama
Adrian Rotama

Reputation: 311

You have multiple version of activesupport. You should remove one of them:

$ gem list | grep activesupport

Activesupport (5.1.1, 5.0.4, 5.0.3, 5.0.2, 5.0.0.1, 4.2.6, 4.2.5, 4.2.4, 4.2.1, 4.1.6)

then

$ gem uninstall activesupport -v 5.1.1

Successfully uninstalled activesupport-5.1.1

In your case, I guess it is activesupport-5.0.6

Upvotes: 1

Related Questions