Rails server - problem

Witam

Właśnie zaczynam naukę ruby on rails.
Używam Ubunt. Ruby i railsy zainstalowałem jak w podręczniku. Nie działa localhost:3000
Po wpisaniu rails server pokazuje się coś takiego:
_Could not find gem ‘rails (= 4.0.2)’ in any of the gem sources listed in your Gemfile or available on this machine.
Run bundle install to install missing gems.

Co mam teraz zrobić? Może dla kogoś to śmieszny problem, ale dopiero zaczynam. Z góry dziękuje za podpowiedź

Odpal bundle install, a potem bundle exec rails server.

po wpisaniu bundle install pojawia się: najpierw Fetching gem metadata from https://rubygems.org/
a na koniec
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling.

Jesli nadal pracujesz na tej wersji ruby z repozytorium to spróbuj zainstalować to:
sudo gem install sys-proctable

od instalowałem udo apt-get purge ruby
potem zainstalowałem jak na stronce rvm.io
ale po wpisaniu rails server pojawia się
Could not find gem ‘rails (= 4.0.2)’ in any of the gem sources listed in your Gemfile or available on this machine.
Run bundle install to install missing gems.

później po wpisaniu bundle install
na końcu komunikat
Using uglifier 3.0.0
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling.

po wpisaniu gem install json -v ‘1.8.3’`
ERROR: Could not find a valid gem ‘1.8.3’ (>= 0) in any repository

czy wiecie może jak zainstalowć ten gem ‘1.8.3’ ?

co wyrzuca Ci jak w konsoli wpiszesz ruby -v ?

Zainstalowałeś rvm, ale czy zainstalowałeś ruby i rails uzywając tegoż rvm?

ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]
po wpisaniu rails -v pokazuje się
Could not find gem ‘rails (= 4.0.2)’ in any of the gem sources listed in your Gemfile or available on this machine.
Run bundle install to install missing gems.

rvm instalowałem tak:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
potem
\curl -sSL https://get.rvm.io | bash -s stable
liuksa użytkuje od soboty tak więc proszę o wyrozumiałość

czyli nie usunałeś ruby’ego, tej wersji z repozytorium.
Usuń go a później:

rvm install ruby-2.3.0

potem: gem install rails

potem: stwórz nowy projekt railsowy

potem bundle install w katalogu projektu

potem rails s w katalogu projektu

wpisałem sudo apt-get purge ruby
następnie rvm install ruby-2.3.0,
gem install rails
potem utworzyłem nowy : rails new nowy
potem: rails server i pojawiło się
Could not find gem ‘rails (= 3.2.16)’ in any of the gem sources listed in your Gemfile or available on this machine.
Run bundle install to install missing gems.
Po wpisaniu bundle install pojawia się
Fetching gem metadata from https://rubygems.org/
itd aż do
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that gem install json -v '1.8.3' succeeds before bundling.

niestety wciąż wychodzi na to, że masz starą wersje rubyego na maszynie.

A jak ją zailnstalować od początku krok po kroku?

Nie wiem, ale jeszcze spróbuj uzyc rvm use 2.3.0 i wtedy wygenerowac nowy projekt itd.

rvm use 2.3.0

RVM is not a function, selecting rubies with ‘rvm use …’ will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use /bin/bash --login as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

w konsoli:
/bin/bash --login
rvm use 2.3.0
stworzenie nowego projektu itp

po wpisaniu rails server
/home/lenovo/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- rails/cli (LoadError) from /home/lenovo/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/bin/rails:7:in `’

/bin/bash --login
rvm use 2.3.0
gem install rails

Teraz, za każdym razem, jak bedziesz otwierał nowe okno terminala, by uzywac rubiego to używaj
/bin/bash --login
Jesli chcesz się tego pozbyc, to uzyj googla :slight_smile:

wpisałem /bin/bash --login i nacisnąłem enter
później rails server
i pokazuje sie
Could not find gem ‘rails (= 3.2.16)’ in any of the gem sources listed in your Gemfile or available on this machine.
Run bundle install to install missing gems.

Za kazdym razem, gdy to widzisz, to pamietaj o rvm use 2.3.0

wpisuje rvm use 2.3.0
potem /bin/bash --login
następnie rails server
/home/lenovo/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- rails/cli (LoadError) from /home/lenovo/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/bin/rails:7:in `’