2017 06,15 03:02 |
|
ruby on rails を勉強中です。
前に、作ったrubyのプロジェクトと同じ階層に新たなプロジェクトを生成 # rails new プロジェクト名 create
create README.md
create Rakefile ~ 略 ~ Bundle complete! 16 Gemfile dependencies, 69 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
The latest bundler is 1.15.1, but you are currently running 1.15.0.
To update, run `gem install bundler`
run bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted
# rails s と入力すると /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:85:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
Gem Load Error is: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Backtrace for gem load error is:
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect'
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
/usr/local/lib/ruby/gems/2.3.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/uglifier-3.2.0/lib/uglifier.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `block in require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `each'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler.rb:108:in `require'
/var/www/ruby_test/railbook/config/application.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:129:in `require'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:129:in `block in perform'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:126:in `tap'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:126:in `perform'
/usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/command/base.rb:63:in `perform'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/command.rb:44:in `invoke'
/usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands.rb:16:in `<top (required)>'
/var/www/ruby_test/railbook/bin/rails:9:in `require'
/var/www/ruby_test/railbook/bin/rails:9:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
/usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
/var/www/ruby_test/railbook/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Bundler Error Backtrace:
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:77:in `block in require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler/runtime.rb:66:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.15.0/lib/bundler.rb:108:in `require'
from /var/www/ruby_test/railbook/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:129:in `require'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:129:in `block in perform'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:126:in `tap'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands/server/server_command.rb:126:in `perform'
from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/lib/ruby/gems/2.3.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/command/base.rb:63:in `perform'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/command.rb:44:in `invoke'
from /usr/local/lib/ruby/gems/2.3.0/gems/railties-5.1.1/lib/rails/commands.rb:16:in `<top (required)>'
from /var/www/ruby_test/railbook/bin/rails:9:in `require'
from /var/www/ruby_test/railbook/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from /usr/local/lib/ruby/gems/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /var/www/ruby_test/railbook/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
勘弁してくれ・・・ 仕方ないので、色々調べてみると もう作ってあるなら、そのプロジェクトフォルダに移動しないとだよ ということか? と思い、 # cd プロジェクト # rails s ~ 同じ ~ さらに調べて Gemfile を修正してみて成功したという例を発見 # vi Gemfile # gem 'therubyracer', platforms: :ruby となっている部分のコメントを外す gem 'therubyracer', platforms: :ruby # rails s => Booting Puma
=> Rails 5.1.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.9.1 (ruby 2.3.3-p222), codename: Private Caller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
起動!!! それなら最初から外しておいてくださいよ。。。 確実に、同じことにはまりそうなので、ここに記載 PR |
|
| HOME | 忍者ブログ [PR]
|