質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.47%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

2回答

707閲覧

Ruby on Railsのサーバーを立ち上げ時にspringが邪魔をしていて立ち上げられない

_chii

総合スコア50

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2020/05/12 14:53

編集2020/05/12 16:48

前提・実現したいこと

Ruby on Railsでサーバーを立ち上げてブラウザに表示させたいのですが、エラーが出てしまい立ち上げることができません。ご教授いただけないでしょうか?

発生している問題・エラーメッセージ

サーバー立ち上げ時
ChisakinoMacBook-Pro:taskleaf Chisaki$ bin/rails s => Booting Puma => Rails 5.2.4.2 application starting in development => Run `rails server -h` for more startup options Exiting You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined). This is probably because you generated binstubs with Spring 1.0, and you now have a Spring version > 1.0 on your system. To solve this, upgrade your bundle to the latest Spring version and then run `bundle exec spring binstub --all` to regenerate your binstubs. This is a one-time step necessary to upgrade from 1.0 to 1.1. Here's the backtrace: /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:285:in `block in load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:285:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' /Users/Chisaki/Desktop/Rails/taskleaf/bin/spring:15:in `<top (required)>' bin/rails:3:in `load' bin/rails:3:in `<main>' ChisakinoMacBook-Pro:taskleaf Chisaki$

試したこと

試した内容として下記のように指定のあったbundle exec spring binstub --allを実行しました。

ChisakinoMacBook-Pro:taskleaf Chisaki$ bundle exec spring binstub --all NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/archive-zip-0.12.0.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/coffee-script-source-1.12.2.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/coffee-rails-4.2.2.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/sprockets-3.7.2.gemspec:19. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/sass-3.7.4.gemspec:21. * bin/rake: Spring inserted * bin/rails: Spring inserted

そのあとにbundle updateを実行してからrails sを試したところ、最初のエラーの表示はなくなりましたがもっと大きなエラーになってしまいました...下記がその内容となります。

ChisakinoMacBook-Pro:taskleaf Chisaki$ bin/rails s NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/archive-zip-0.12.0.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/coffee-script-source-1.12.2.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/coffee-rails-4.2.2.gemspec:16. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/sprockets-3.7.2.gemspec:19. NOTE: Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01. Gem::Specification#rubyforge_project= called from /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/specifications/sass-3.7.4.gemspec:21. Beginning in Rails 4, Rails ships with a `rails` binstub at ./bin/rails that should be used instead of the Bundler-generated `rails` binstub. If you are seeing this message, your binstub at ./bin/rails was generated by Bundler instead of Rails. You might need to regenerate your `rails` binstub locally and add it to source control: rails app:update:bin # Bear in mind this generates other binstubs # too that you may or may not want (like yarn) If you already have Rails binstubs in source control, you might be inadverently overwriting them during deployment by using bundle install with the --binstubs option. If your application was created prior to Rails 4, here's how to upgrade: bundle config --delete bin # Turn off Bundler's stub generator rails app:update:bin # Use the new Rails executables git add bin # Add bin/ to source control You may need to remove bin/ from your .gitignore as well. When you install a gem whose executable you want to use in your app, generate it and add it to source control: bundle binstubs some-gem-name git add bin/new-executable => Booting Puma => Rails 5.2.4.2 application starting in development => Run `rails server -h` for more startup options Exiting You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined). This is probably because you generated binstubs with Spring 1.0, and you now have a Spring version > 1.0 on your system. To solve this, upgrade your bundle to the latest Spring version and then run `bundle exec spring binstub --all` to regenerate your binstubs. This is a one-time step necessary to upgrade from 1.0 to 1.1. Here's the backtrace: /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:55:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:285:in `block in load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:257:in `load_dependency' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activesupport-5.2.4.2/lib/active_support/dependencies.rb:285:in `load' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' /Users/Chisaki/.rbenv/versions/2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:92:in `require' /Users/Chisaki/Desktop/Rails/taskleaf/bin/spring:15:in `<top (required)>' bin/rails:4:in `load' bin/rails:4:in `<main>' ChisakinoMacBook-Pro:taskleaf Chisaki$

エラー文の内容理解を試みましたが理解できませんでした...

補足情報(FW/ツールのバージョンなど)

Ruby on Rails5
MacOS

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

自分の場合だけかもですがgem 'font-awesome-sass', '~> 5.2.0'を入れていたのですが、最新のバージョンに変えたら直りました。

Springのバージョンを上げろというエラー文ですが、エラー文通りの対処をしても自分も上手くいかなかったので、どうやら新しくインストールしたGemが何らかの形でSpringに干渉していたのではないかと。

投稿2020/07/12 12:59

maztak

総合スコア61

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

ベストアンサー

bundle exec spring binstub --all

を実行して、binstub を更新せよと書いてますが、実行されましたでしょうか?

【エラーが変わったことを受けた追記です】

以下のいずれかを実施する必要がありそうです。

● 以下で binstub を作成しなおす。

rails app:update:bin

● アプリを Rails4 で作成したものであれば、以下の手順を実行

bundle config --delete bin rails app:update:bin git add bin

なお、じ後、実行可能な gem をインストールした際は、以下を実行するように書かれています。

bundle binstubs some-gem-name git add bin/new-executable

some-gem-name bin/new-executable をインストールした gem の名前
bin/new-executable 新たにインストールされた実行可能ファイル

申し訳ありませんが、内容については、未検証です。

投稿2020/05/12 15:11

編集2020/05/12 19:19
Yasumichi

総合スコア1773

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

_chii

2020/05/12 16:51

ご回答ありがとうございます。ご指摘のあった内容箇所の修正を行いましたが、エラーがより複雑になりエラー文の理解も難しい状態となってしまいました...本文は現在のエラーの状態に編集してあります。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.47%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問