Rails Server keeps exiting on "rails server" command - ruby-on-rails

Here are my specs: Ruby 2.4.0, Rails 5.1.3, postgres 9.6, windows 10 running rails with Bash Ubuntu. Whenever I try running rails server it exits me, I'm at the root of the project. It wasn't happening before. Here are the gems I recently installed: boostrap-sass, devise, toastr-rails, omniauth, omniauth-facebook
rails server
=> Booting Puma
=> Rails 5.1.3 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Exiting
/home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:228:in `mkdir': File exists # dir_s_mkdir - /mnt/c/Users/xxxxx/Desktop/xxxxx/tmp/pids (Errno::EEXIST)
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:228:in `fu_mkdir'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:206:in `block (2 levels) in mkdir_p'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:204:in `reverse_each'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:204:in `block in mkdir_p'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:190:in `each'
from /home/mark/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/fileutils.rb:190:in `mkdir_p'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:75:in `block in create_tmp_directories'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:74:in `each'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:74:in `create_tmp_directories'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:40:in `start'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:131:in `block in perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `tap'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands/server/server_command.rb:126:in `perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/command/base.rb:63:in `perform'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/command.rb:44:in `invoke'
from /home/mark/.rvm/gems/ruby-2.4.0/gems/railties-5.1.3/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

Remove the folder or file /mnt/c/Users/xxxxx/Desktop/xxxxx/tmp/pids and try again?

Related

Rails Console won't run (console error)

I'd like to run rails console command but it throw error everytime I run it.
Here is the error I get :
Loading development environment (Rails 5.1.4)
D:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0/rbreadline.rb:6090:in `delete': invalid byte sequence in UTF-8 (ArgumentErr
or)
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0/rbreadline.rb:6090:in `alloc_history_entry'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0/rbreadline.rb:6123:in `add_history'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/site_ruby/2.3.0/readline.rb:368:in `<<'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:76:in `block (2 levels) in load_history'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:76:in `each'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:76:in `block in load_history'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:75:in `open'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:75:in `load_history'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:65:in `extended'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:21:in `extend'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:21:in `init_save_history'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/ext/save-history.rb:45:in `save_history='
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb/context.rb:91:in `initialize'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb.rb:426:in `new'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb.rb:426:in `initialize'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb.rb:383:in `new'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/2.3.0/irb.rb:383:in `start'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:6
2:in `start'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:1
7:in `start'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/console/console_command.rb:9
7:in `perform'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from D:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've tried to reinstall/reinstall and clean every version of ruby with no success. I use Ruby 2.3.3 and rails 5.1.4.
Thanks
Since you are on Windows(I'm assuming since you have D:/):
Try installing rb-readline gem in your development group. That's the easiest way for solving readline issues.
There are other solutions as well if that doesn't work.

rails server error `initialize': getaddrinfo: Name or service not known (SocketError)

I am attempting to set up a new Rails app and keep getting the following stack trace:
=> Booting Puma
=> Rails 5.1.0.rc1 application starting in development on http://linux-my4o:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.8.2 (ruby 2.4.0-p0), codename: Sassy Salamander
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://linux-my4o:9292
Exiting
/home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': getaddrinfo: Name or service not known (SocketError)
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `new'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `add_tcp_listener'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:105:in `block in parse'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `each'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/binder.rb:88:in `parse'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/runner.rb:144:in `load_and_bind'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/single.rb:87:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/puma/launcher.rb:172:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/puma-3.8.2/lib/rack/handler/puma.rb:64:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/rack-2.0.1/lib/rack/server.rb:296:in `start'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:44:in `start'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:130:in `block in perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125:in `tap'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands/server/server_command.rb:125:in `perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/command.rb:27:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor/invocation.rb:126:in `invoke_command'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/thor-0.19.4/lib/thor.rb:369:in `dispatch'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/command/base.rb:63:in `perform'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/command.rb:44:in `invoke'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/railties-5.1.0.rc1/lib/rails/commands.rb:16:in `<top (required)>'
from /home/chris/Projects/cwatsondev-api/bin/rails:9:in `require'
from /home/chris/Projects/cwatsondev-api/bin/rails:9:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `load'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/rails.rb:28:in `call'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client/command.rb:7:in `call'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/client.rb:30:in `run'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/bin/spring:49:in `<top (required)>'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `load'
from /home/chris/.rvm/gems/ruby-2.4.0/gems/spring-2.0.1/lib/spring/binstub.rb:31:in `<top (required)>'
from /home/chris/Projects/cwatsondev-api/bin/spring:15:in `require'
from /home/chris/Projects/cwatsondev-api/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I've never seen an error like this when running a rails server before. I'm using Rails 5.1.0.rc1 on OpenSuse Tumbleweed. It looks to me like it's having an issue with the hostname linux-my4o.
I figured it out. Just had to add a new line to my etc/hosts file.
127.0.0.1 linux-my4o
I fixed mine by adding the following lines to my environment variables. For linux i added the following line
export HOST="localhost"
if this does not work especially because rails is complaining that the HOST envvar will be depreciated, use this instead
export BINDING="localhost"

Rbenv says Ruby 2.1.2 isn't installed even after I installed it

When I used rails s to initiate the Rails server I get this.
➜ zumin-share git:(master) rails s
rbenv: version `2.1.2' is not installed (set by /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/.ruby-version)
I then try to install rbenv 2.1.2 and the installer should be finished. I checked Rbenv version and I get.
rbenv version
2.1.2 (set by /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/.ruby-version)
I thought it was the .ruby-version file giving me trouble and when I removed it I get.
rails s
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/smart_listing-1.0.0/lib/smart_listing/config.rb:73: warning: duplicated key at line 79 ignored: :href
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/ansi-1.4.3/lib/ansi/chart.rb:26: warning: duplicated key at line 29 ignored: :concealed
=> Booting Thin
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application/configuration.rb:110:in `database_configuration': Cannot load `Rails.application.database_configuration`: (RuntimeError)
Could not load database configuration. No such file - ["config/database.yml"]
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railtie.rb:116:in `block in <class:Railtie>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config/environment.rb:5:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:3:in `block in <main>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:in `new'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/config.ru:in `<main>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/rails:8:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/rails:8:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/rails.rb:27:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client/command.rb:7:in `call'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/client.rb:26:in `run'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/bin/spring:48:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `load'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/spring-1.2.0/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/var/rbenv/versions/2.2.3/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/ericxavierdoyle/Eric_Dev/ElliotWhyte/zumin-share/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
What am I doing wrong?
Your .ruby-version file is used by rbenv to detect what version of Ruby to use(besides looking in this file rbenv also looks in RBENV_VERSION environment variable if it's specified, and some other files). So in your case specified Ruby version was 2.1.2 and since it's not installed on your system rbenv complained about that, but since rbenv looks on few other places to detect what version of Ruby to use it found some other version and used it to run your code.
After installing version 2.1.2 your system now have version defined in your .ruby-version and rbenv will use it to run your code, but since your gems are installed for version of Ruby that you were using before 2.1.2 you'll get errors. At least I think that's what is going on, it would be great if some experienced programmer can comment on this.

Can't launch rails server after reinstalling rvm/rails

I recently had to uninstall rvm and then reinstall rvm and reinstall rails --
It appears that rails didn't install correctly because I can't launch rails s. I'm working with ruby 2.3.0, and ran sudo gem install rails to get the latest version of rails.
After installing and running bundle install and bundle update, I got this error
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mkdir': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
Permission denied - ./.gem.20160330-64997-1erpjjg
Gem files will remain installed in /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /Users/chloe/.rvm/gems/ruby-2.3.0#global/extensions/universal-darwin-14/2.0.0/nokogiri-1.6.7.2/gem_make.out
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `block in mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:142:in `create'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:85:in `mktmpdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/ext_conf_builder.rb:14:in `build'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `chdir'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:160:in `block in build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `synchronize'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:159:in `build_extension'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/ext/builder.rb:195:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1436:in `block in build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/user_interaction.rb:45:in `use_ui'
from /Library/Ruby/Site/2.0.0/rubygems/specification.rb:1434:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/stub_specification.rb:60:in `build_extensions'
from /Library/Ruby/Site/2.0.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:68:in `block in require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `each'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `find'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:67:in `require'
from /Users/chloe/.rvm/gems/ruby-2.3.0#global/gems/railties-4.2.6/bin/rails:9:in `<top (required)>'
from /usr/bin/rails:22:in `load'
from /usr/bin/rails:22:in `<main>'
I tried using the solution from this question, but got 'apt-get command not found' --- but I apologize if this requires a similar solution!
I'm using Mac OSX
EDIT ****
after updating gems with gem update ---system, I have a new error message:
=> Booting WEBrick
=> Rails 4.1.4 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/chloe/sites/bookshelf/config/environment.rb:7:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /Users/chloe/sites/bookshelf/config.ru:3:in `require'
from /Users/chloe/sites/bookshelf/config.ru:3:in `block in <main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from /Users/chloe/sites/bookshelf/config.ru:in `new'
from /Users/chloe/sites/bookshelf/config.ru:in `<main>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `eval'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:49:in `new_from_string'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:199:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:50:in `app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/rack-1.5.5/lib/rack/server.rb:314:in `wrapped_app'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/server.rb:67:in `start'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/railties-4.1.4/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `require'
from /Users/chloe/sites/bookshelf/bin/rails:9:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/rails.rb:28:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client/command.rb:7:in `call'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/client.rb:28:in `run'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/bin/spring:49:in `<top (required)>'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `load'
from /Users/chloe/.rvm/gems/ruby-2.3.0/gems/spring-1.6.4/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `require'
from /Users/chloe/sites/bookshelf/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
[1]: https://stackoverflow.com/questions/7645918/require-no-such-file-to-load-mkmf-loaderror
****SOLUTION****
the solution from this question appeared to fix it:
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.
This appeared to solve the problem:
For the first issue--
run
gem update --system
For second issue --
in your enviroment.rb file, cut any line starting with config and paste into your production.rb/development.rb/test.rb instead.

Ruby on rails - Error running rails s command

I installed the Rails installer in my Win7 machine from http://railsinstaller.org/. I already had the Ruby 1.9.2-p290. After installing the ROR through the installer, I rain rails s to start the server and I get the following error. Could anybody help me understanding the reason of this error>?
C:\Sites\ridemo>rails s
=> Booting WEBrick
=> Rails 3.1.0.rc6 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0.rc6/lib/sp
rockets/railtie.rb:21:in `block (2 levels) in <class:Railtie>': undefined method
`static_root=' for #<Sprockets::Environment:0x361d178> (NoMethodError)
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/sprockets-2.0.
0/lib/sprockets/environment.rb:55:in `initialize'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `new'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/actionpack-3.1
.0.rc6/lib/sprockets/railtie.rb:20:in `block in <class:Railtie>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `instance_exec'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:25:in `run'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:50:in `block in run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `each'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/initializable.rb:49:in `run_initializers'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/application.rb:92:in `initialize!'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/railtie/configurable.rb:30:in `method_missing'
from C:/Sites/ridemo/config/environment.rb:5:in `<top (required)>'
from C:/Sites/ridemo/config.ru:4:in `require'
from C:/Sites/ridemo/config.ru:4:in `block in <main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `instance_eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:51:in `initialize'
from C:/Sites/ridemo/config.ru:1:in `new'
from C:/Sites/ridemo/config.ru:1:in `<main>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `eval'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/builder.rb:40:in `parse_file'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:200:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:46:in `app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:301:in `wrapped_app'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/rack-1.3.2/lib
/rack/server.rb:252:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands/server.rb:70:in `start'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:54:in `block in <top (required)>'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `tap'
from C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/railties-3.1.0
.rc6/lib/rails/commands.rb:49:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
RailsInstaller now supports Rails 3.1, but promise nothing about previous RC versions. Like #Fabio said, try to update to the latest Rails version (change it in your Gemfile). Also, if you already had a ruby version installed, be sure you are using the RailsInstaller one by checking your system environment path variable. The one and only path to Ruby should be :
C:\RailsInstaller\Ruby1.9.2\bin;
needed to run the following and It resolved the problem:-
gem install rails -v=3.1.0.rc8
From (https://github.com/sstephenson/sprockets/issues/172)

Resources