New Rails Project: 'bundle install' can't install rails in gemfile

前端 未结 9 1629
不知归路
不知归路 2020-12-11 06:37

I have installed a new rails project like so:

$ rails new site

and it executes and reaches:

bundle install
<
相关标签:
9条回答
  • 2020-12-11 06:50

    First uninstall any existing atomic gem

    gem uninstall atomic
    

    Then reinstall it using

    gem install atomic -v '1.1.16'
    

    After this try to create a new rails application

    rails new projectname
    

    I don't know which version of Rails you are currently using. Sometimes, re-installing Rails to a stable version seems to help. You may want to try that as well if the above steps didn't resolve the issue.

    0 讨论(0)
  • 2020-12-11 06:57

    Ruby 2.1.5 on Maverick via rvm installed atomic 1.1.16 without issue.

    0 讨论(0)
  • 2020-12-11 06:58

    This appears to be an issue relating to the system Ruby that is packaged with Mavericks (2.0.0p247), see details about the bug here: https://bugs.ruby-lang.org/issues/9624

    I got around this by installing rbenv (or RVM if you prefer) and then installing Ruby 2.1.1 so as not to tamper with the system Ruby version. You will still get a warning during the installation of the atomic gem but it won't fail at least.

    rbenv here: https://github.com/sstephenson/rbenv

    0 讨论(0)
  • 2020-12-11 07:02

    I had a similar problem recently and it was because Xcode updated automatically to 5.1. This version contains a bug/problem with gcc.

    The clue is here:

    -Wunused-command-line-argument-hard-error-in-future]
    clang: note: this will be a hard error (cannot be downgraded to a warning)
    

    Sadly I had to downgrade Xcode - available here.

    0 讨论(0)
  • 2020-12-11 07:02

    None of these worked for me. I came up with my own solution. The problem lies in json versions less than 2.0. When I tried to upgrade json, I got an error message about dependency issues with rails and sdoc. Here's what I ended up doing:

    1. Open your Gemfile.
    2. Comment out the lines for sdoc and rails.
    3. Add this line: gem 'json', '> 2'
    4. Run bundle install.

    Worked for me.

    0 讨论(0)
  • 2020-12-11 07:04

    this worked for me: sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install rails

    0 讨论(0)
提交回复
热议问题