Cannot start rails server, I get an error - ruby-on-rails

I'm new to Ruby on Rails. So, I'd got this error before, and I reinstalled rails and ruby and installed them again, but I still get it.
The error is:
/home/X/.rvm/gems/ruby-2.2.1/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/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/X/Documents/Appw/config/application.rb:7:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /home/X/Documents/Appw/bin/rails:9:in `require'
from /home/X/Documents/Appw/bin/rails:9:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/command.rb:7:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client.rb:28:in `run'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/bin/spring:51:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/X/Documents/Appw/bin/spring:13:in `require'
from /home/X/Documents/Appw/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I tried updating the uglifier gem, but nothing happened.

It looks like you have't installed nodejs
sudo apt-get install nodejs
Should work !!!

The problem was that I didn't have nodejs installed. After I've installed it, everything worked smoothly.

What is you gemfile/gem list?
Actually having meteor installed doesn't count as having nodejs installed. nodejs is required for uglifier package, so simple: yum install nodejs resolves the issue.

Related

Could not open library '/usr/lib/libmecab.so.2': /usr/lib/libmecab.so.2: cannot open shared object file: No such file or directory (LoadError)

when i tried to start my rails server i got an error related to mecab
So i followed below given instruction to install mecab and it was installed successfully
i checked the version of mecab
while installing mecab followed steps are
1. gem install natto
2. sudo apt-get install mecab libmecab-dev
3. sudo apt-get install mecab-ipadic-utf8
4. mecab --version
5. sudo find / -name libmecab.so*
this gives an error of permission denied
6. echo 'export MECAB_PATH=/usr/lib/libmecab.so.2' >> ~/.bash_profile
7. source ~/.bash_profile
After all, this when I tried to start rails server I got below given error
/home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:147:in `block in ffi_lib': Could not open library '/usr/lib/libmecab.so.2': /usr/lib/libmecab.so.2: cannot open shared object file: No such file or directory (LoadError)
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `map'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/ffi-1.9.14/lib/ffi/library.rb:100:in `ffi_lib'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:64:in `<module:Binding>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:6:in `<module:Natto>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/binding.rb:2:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto/natto.rb:2:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `block in require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/natto-1.1.1/lib/natto.rb:2:in `<top (required)>'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:81:in `block (2 levels) in require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `each'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:76:in `block in require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `each'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler/runtime.rb:65:in `require'
from /usr/share/rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/bundler.rb:114:in `require'
from /home/admin123/WFSGo/myproject/config/application.rb:16:in `<top (required)>'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/admin123/.rvm/gems/ruby-2.3.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
On Ununtu the mecab lib is in /usr/lib/x86_64-linux-gnu/libmecab.so. So this should work:
export MECAB_PATH=/usr/lib/x86_64-linux-gnu/libmecab.so
rails server

Nokogiri Incompatible Library Error when trying to Use Carrierwave Gem uploader - Rails

I'm trying to use the Carrierwave gem to add pictures to my site. As soon as I use the gem uploader, I get the following error telling me that I have an incompatible library version referencing Nokogiri 1.8.1 ...
/Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `require': incompatible library version - /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri/nokogiri.bundle (fatal)
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:32:in `rescue in <top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/nokogiri-1.8.1/lib/nokogiri.rb:28:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/loofah-2.1.1/lib/loofah.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/rails-html-sanitizer-1.0.3/lib/rails-html-sanitizer.rb:2:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/sanitize_helper.rb:2:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/sanitize_helper.rb:2:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:32:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:32:in `<module:TextHelper>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:29:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:6:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/text_helper.rb:4:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:18:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:18:in `<module:FormTagHelper>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:14:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:8:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_tag_helper.rb:6:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_helper.rb:4:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers/form_helper.rb:4:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:50:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:50:in `<module:Helpers>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:4:in `<module:ActionView>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/actionview-5.0.6/lib/action_view/helpers.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/context.rb:1:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/context.rb:1:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:7:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:7:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:14:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:14:in `block in <top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:12:in `each'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/railties-5.0.6/lib/rails/all.rb:12:in `<top (required)>'
from /Users/danieluribe/code/one_stop_ror/yelpdemo/config/application.rb:3:in `require'
from /Users/danieluribe/code/one_stop_ror/yelpdemo/config/application.rb:3:in `<top (required)>'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
from /Users/danieluribe/.rvm/gems/ruby-2.3.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/danieluribe/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/danieluribe/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
Most of the solutions I've seen online include references to libxml2 but I see no references in my error to that. I have however tried the solution here with no success.
I have uninstalled and reinstalled both nokogiri and libxml multiple times using brew. I've also used the installation for Nokogiri on Mac as mentioned on their page here.
I'm not 100-percent sure if it's simply a Nokogiri error or whether libxml2 requires a different version than the default. The current version I'm using for libxml2 is 2.9.3. Any help or pointing in the right direction will be greatly appreciated. Let me know if more details are needed.
Try installing the development files if you haven't already:
sudo apt-get install g++ build-essential -y
EDIT: Oops, for mac try this: https://github.com/kennethreitz/osx-gcc-installer
EDIT: Another idea, remove Nokogiri version from the Gemfile then try
gem install nokogiri -v 1.6.8.1 -- --use-system-libraries=true --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/libxml2

ruby app is giving problems with incompatible libraries

while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.

Rails development environment after new distro is installed in /root and /home kept same

I changed my distro from Ubuntu to Elementary OS. I kept my /home directory, so that I don't have to install anything.
I followed GoRail's guide to install Rails.
Now when I try to re-install everything from the same guide, it turns out that RVM, Ruby and Rails are already there.
➜ sample_app git:(master) ✗ rails -v
Rails 4.2.2
However, when I go to my old projects and try to start a server it throws the following error:
➜ sample_app git:(master) ✗ rails s
/home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/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/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/config/application.rb:7:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/rails:9:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
from /home/abhimanyuaryan/.rvm/gems/ruby-2.2.3/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `require'
from /home/abhimanyuaryan/Public/RoR/sample_app/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
➜ sample_app git:(master) ✗
As per your error message
There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
It seems you don't have NodeJS installed. Run
sudo apt-get install nodejs
bundle install
See "There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)".

Rails server won't run

I have been trying to setup Ruby on Rails for the past 2 days now. I had them running at one stage but broke it. I have gone through re-installing Ruby and Rails via RVM and I am attempting to get going on the tutorial I have been working on. The problem I have is that when I run the command 'rails s' within the Rails app directory I get the following error message:
Exiting
/home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require': no such file to load -- openssl (LoadError)
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/session/cookie.rb:1:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in `load_dependency'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
from /home/hugo/.rvm/gemsin my terminal /ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/session/cookie_store.rb:4:in `<top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `const_get'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/configuration.rb:131:in `session_store'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:172:in `block in default_middleware_stack'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `tap'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:146:in `default_middleware_stack'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/engine.rb:446:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `instance_exec'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:30:in `run'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `each'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/initializable.rb:54:in `run_initializers'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/application.rb:96:in `initialize!'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/hugo/rails_projects/web_app/config/environment.rb:5:in `<top (required)>'
from /home/hugo/rails_projects/web_app/config.ru:4:in `require'
from /home/hugo/rails_projects/web_app/config.ru:4:in `block in <main>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `instance_eval'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:51:in `initialize'
from /home/hugo/rails_projects/web_app/config.ru:1:in `new'
from /home/hugo/rails_projects/web_app/config.ru:1:in `<main>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `eval'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/builder.rb:40:in `parse_file'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:200:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:46:in `app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:301:in `wrapped_app'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.3.5/lib/rack/server.rb:252:in `start'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in `start'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:54:in `block in <top (required)>'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `tap'
from /home/hugo/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.1/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Can somebody explain to me this error please? I am getting very tired. Thanks in advance.
You compiled ruby without the openssl dependencies. Do
rvm requirements
(or rvm notes if you are using an older version of rvm that doesn't have rvm requirements)
and see what you need to install in your system (typically these are apt-get commands if you are running ubuntu for example), and then recompile your ruby installation
by
rvm remove 1.9.2
rvm install 1.9.2
The first line has the following error:
`require': no such file to load -- openssl (LoadError)
RVM needs to know how to get to your openssl library.
See http://beginrescueend.com/packages/openssl/ for more information on setting up openssl with RVM.

Resources