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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

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

Q&A

解決済

3回答

3232閲覧

ローカル環境のRails5.0.0が立ち上がらない

cont

総合スコア13

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

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

0グッド

0クリップ

投稿2016/10/04 09:30

編集2016/10/05 01:50

###前提
本番サーバは問題なく動作中で、ローカルの開発環境でのみrailsが起動しません。

###発生している問題・エラーメッセージ
bundle exec rails sだと下記のメッセージの後、エラー自体は出ずにそのまま元のプロンプトに戻ります。

Looks like your app's ./bin/rails is a stub that was generated by Bundler. In Rails 5, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand. Here's how to upgrade: bundle config --delete bin # Turn off Bundler's stub generator rails app:update:bin # Use the new Rails 5 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

bundle exec rails cでも同様。

bin/rails sを実行すると、上記メッセージの後に下記のエラーが出力されます。

/Users/hoge/home/p3commerce/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `require': incompatible library version - /Users/hoge/home/p3commerce/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri/nokogiri.bundle (fatal) from /Users/hoge/home/p3commerce/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri.rb:32:in `rescue in <top (required)>' from /Users/hoge/home/p3commerce/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri.rb:28:in `<top (required)>' (以下出力略)

###試したこと

Gemの削除からのbundle installし直し、binの削除からのbundle installし直しは実施。
Gemfile.lockは特に本番環境と差分が出てません。

###補足情報(言語/FW/ツール等のバージョンなど)
rails 5.0.0rc
ruby 2.3.1
Mac OSX 10.12
rbenv

$ which rbenv /usr/local/bin/rbenv $ rbenv --version rbenv 1.0.0 $ rbenv versions system 2.2.3 * 2.3.1 $ which ruby /Users/hoge/.rbenv/shims/ruby $ ruby --version ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] $ bundle exec gem list | grep noko nokogiri (1.6.8) $ bundle config Settings are listed in order of priority. The top value will be used. path Set for your local app (/Users/hoge/home/p3commerce/.bundle/config): "vendor/bundle" jobs Set for your local app (/Users/hoge/home/p3commerce/.bundle/config): "4" disable_shared_gems Set for your local app (/Users/hoge/home/p3commerce/.bundle/config): "true" bin Set for your local app (/Users/hoge/home/p3commerce/.bundle/config): "bin" $ bundle exec rails --version Looks like your app's ./bin/rails is a stub that was generated by Bundler. In Rails 5, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand. Here's how to upgrade: bundle config --delete bin # Turn off Bundler's stub generator rails app:update:bin # Use the new Rails 5 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 Rails 5.0.0.rc2 ohaleMac:p3commerce oshale$ bin/rails --version Looks like your app's ./bin/rails is a stub that was generated by Bundler. In Rails 5, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand. Here's how to upgrade: bundle config --delete bin # Turn off Bundler's stub generator rails app:update:bin # Use the new Rails 5 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 Rails 5.0.0.rc2

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

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

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

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

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

guest

回答3

0

自己解決

本番から再度クローンで解決しました。
Sierraにアップデートしてたせいか、bundle installがうまく動作しなかったのですが、Terminalから
xcode-select --installで解消。

一応残していたクローン前の動かなかった環境で再度bundle installbundle exec rails sを実行するも、そちらの方は解消されてなかったので、結局原因は不明です。

投稿2016/10/05 05:47

cont

総合スコア13

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

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

0

もう少し詳細な情報がほしいです

本番サーバは問題なく動作中で、ローカルの開発環境でのみrailsが起動しません。

何をしたら動かなくなったのか?

  • エラーの前後10行ずつくらい()
  • Rails 5のプロジェクトを新規に作成したのか、それとも4からアップグレードしたのか?
  • 各バージョン、設定情報
cd $PROJECT_ROOT which rbenv rbenv --version rbenv versions which ruby ruby --version gem list | grep noko bundle config bundle exec rails --version bin/rails --version

投稿2016/10/04 11:41

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

cont

2016/10/05 01:50 編集

>何をしたら動かなくなったのか? 判断が難しい所なんですが、長いことpullしてなかったローカルのリポジトリを更新したら動かなくなった感じです。 元々rails5で作っていたものです。 ご指定の各バージョン、設定情報は詳細に追記しました。rails系のコマンドが基本動かないのですが、エラーが出力されないので四苦八苦しております。
退会済みユーザー

退会済みユーザー

2016/10/05 05:34

参考に私の`bin/rails`です。 ``` #!/usr/bin/env ruby begin load File.expand_path('../spring', __FILE__) rescue LoadError => e raise unless e.message.include?('spring') end APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' ```
退会済みユーザー

退会済みユーザー

2016/10/05 05:35

しかしRailsのバージョンがRCですけどいいのかな?RCって普通はプロダクトでは使わないと思うけど。私のプロジェクトのRailsは`5.0.0.1`です。
退会済みユーザー

退会済みユーザー

2016/10/05 05:36

最後にこれはやってみました? ``` Here's how to upgrade: bundle config --delete bin # Turn off Bundler's stub generator rails app:update:bin # Use the new Rails 5 executables git add bin # Add bin/ to source control You may need to remove bin/ from your .gitignore as well. ```
cont

2016/10/05 06:43

これやってみたのですが、動きませんでした。 同じメッセージが出て止まっていたので、railsコマンド全般効いていない印象でした。 binの削除は上記コマンドでも`rm -rf bin`でも試しましたが、同様でした。
guest

0

ruby 2.3.1 をご利用とのことですが、ログでは ruby 2.3.0 にパスが通っているように見えます

/Users/hoge/home/p3commerce/vendor/bundle/ruby/2.3.0/gems/nokogiri-1.6.8/lib/nokogiri.rb

rbenvの設定や、 Gemfileの rubyバージョンの指定などを見なおしてはどうでしょうか。

投稿2016/10/04 09:40

Kuchitama

総合スコア181

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

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

退会済みユーザー

退会済みユーザー

2016/10/04 11:28

その`2.3.0`はマイナーバージョンまでが反映されるので、パッチバージョンは反映されないんじゃなかったでしたっけ? 自分の手元でもそうなってたので ``` [anonymous@localhost my_project]$ rbenv --version rbenv 1.0.0-30-g0c7224a [anonymous@localhost my_project]$ rbenv version 2.3.1 (set by /home/anonymous/my_project/.ruby-version) [anonymous@localhost my_project]$ ls vendor/bundle/ruby/ 2.3.0 ```
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問