Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Restarting rails server


  • Please log in to reply
6 replies to this topic

#1 astonecipher

astonecipher

    Passenger

  • Members
  • 5 posts

Posted 03 March 2014 - 01:42 AM

When I am working on a site everything works as it should. When I log off or shut down the computer the server will not restart, I just get this output:

 

andrew@toshibshit:/var/www/rails/micro$ rails server
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]              # Path to the Ruby binary of your choice
                                 # Default: /home/andrew/.rvm/rubies/ruby-2.1.1/bin/ruby
  -b, [--builder=BUILDER]        # Path to a application builder (can be a filesystem path or URL)
  -m, [--template=TEMPLATE]      # Path to an application template (can be a filesystem path or URL)
      [--skip-gemfile]           # Don't create a Gemfile
      [--skip-bundle]            # Don't run bundle install
  -G, [--skip-git]               # Skip Git ignores and keeps
  -O, [--skip-active-record]     # Skip Active Record files
  -S, [--skip-sprockets]         # Skip Sprockets files
  -d, [--database=DATABASE]      # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                 # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]  # Preconfigure for selected JavaScript library
                                 # Default: jquery
  -J, [--skip-javascript]        # Skip JavaScript files
      [--dev]                    # Setup the application with Gemfile pointing to your Rails checkout
      [--edge]                   # Setup the application with Gemfile pointing to Rails repository
  -T, [--skip-test-unit]         # Skip Test::Unit files
      [--old-style-hash]         # Force using old style hash (:foo => 'bar') on Ruby >= 1.9

Runtime options:
  -f, [--force]    # Overwrite files that already exist
  -p, [--pretend]  # Run but do not make any changes
  -q, [--quiet]    # Suppress status output
  -s, [--skip]     # Skip files that already exist

Rails options:
  -h, [--help]     # Show this help message and quit
  -v, [--version]  # Show Rails version number and quit

Description:
    The 'rails new' command creates a new Rails application with a default
    directory structure and configuration at the path you specify.

    You can specify extra command-line arguments to be used every time
    'rails new' runs in the .railsrc configuration file in your home directory.

    Note that the arguments specified in the .railsrc file don't affect the
    defaults values shown above in this help message.

Example:
    rails new ~/Code/Ruby/weblog

    This generates a skeletal Rails installation in ~/Code/Ruby/weblog.
    See the README in the newly created application to get going.

 

I have attempted to rebundle everything and start and nothing changes. I am using Ubuntu 12.04 LTS



#2 danielhanke

danielhanke

    Signalman

  • Members
  • 12 posts
  • LocationCologne, Germany

Posted 03 March 2014 - 06:42 AM

hey astonecipher,

 

do you use rvm or any ruby manager / selector?

 

did you maybe remove some folders like scripts? 



#3 astonecipher

astonecipher

    Passenger

  • Members
  • 5 posts

Posted 03 March 2014 - 07:17 AM

I am using rvm, but nothing has been removed. I literally have to recreate everything for the server to start working again. Right now I am using a laptop as the development enviroment. So, when the laptop shuts down improperly it happens.



#4 danielhanke

danielhanke

    Signalman

  • Members
  • 12 posts
  • LocationCologne, Germany

Posted 03 March 2014 - 08:20 AM

just want to ensure.

did you update your major rails version? is the correct gemset (e.h.) loaded? 

what does `gem list rails`  say? 



#5 astonecipher

astonecipher

    Passenger

  • Members
  • 5 posts

Posted 03 March 2014 - 01:43 PM

 

*** LOCAL GEMS ***

bigdecimal (1.2.0)
bundler (1.5.3)
bundler-unload (1.0.2)
executable-hooks (1.3.1)
gem-wrappers (1.2.4)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
rubygems-bundler (1.4.2)
rvm (1.11.3.9)
test-unit (2.0.0.0)
 

 

 

Is this what you are asking about? New to Ruby and Rails so this is far different than what I am use to working against.



#6 danielhanke

danielhanke

    Signalman

  • Members
  • 12 posts
  • LocationCologne, Germany

Posted 03 March 2014 - 08:25 PM   Best Answer

yep,

 

seems like you either did not select the corrent ruby or gemset in rvm.

 

did you hit something like ``rvm use 2.1.0`` first time using your rails project?

 

if yes, you could create a .ruby-version file in your rails-app-directory, containing

ruby-2.1.0

for example.

 

then, try

cd
cd /var/www/rails/micro

and retry `rails s`.

 

all of this when you changed your ruby version back then. the chage is not permanent unless you tell rvm to make it default.


  • james likes this

#7 astonecipher

astonecipher

    Passenger

  • Members
  • 5 posts

Posted 04 March 2014 - 12:21 AM

That seems to have fixed it. It may have boiled down to two different problems, I was using a different version via rvm use; and the gemfile had a different version that the rvm statement. Deleting and changing the default in rvm is working for now.

 

 

Thank you


  • danielhanke likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users