Mengapa saya mendapatkan kesalahan ini?
shibly@mybox:~/blog$ rails server
/home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/shibly/.gem/ruby/2.2.4/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/shibly/blog/config/application.rb:7:in `<top (required)>'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/shibly/.gem/ruby/2.2.4/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:9:in `require'
from bin/rails:9:in `<main>
ruby-on-rails
ruby-on-rails-4
server
dengan tangkas
sumber
sumber
Jawaban:
Anda harus menjalankan perintah berikut untuk menginstal NodeJS di Ubuntu
atau jalankan ini untuk OSX
Uglifier adalah pembungkus JS dan membutuhkan runtime JS yang berjalan atau juru bahasa JS. Saya akan memilih untuk menginstal NodeJS.
sumber
/usr/bin/nodejs
tempat yang diharapkan eksekutif untuk menemukannya.Dalam Rails Gemfile default, baris untuk permata 'therubyracer' dikomentari. Jika Anda menghapusnya, Anda akan mendapatkan permata itu dan seharusnya berfungsi.
Dari " Memulai Rails ":
sumber
Terjadi kesalahan saat membuat db.
Masalahnya adalah Node.js mencoba memasang tanpa
sudo
di skrip:sumber