how to run rails project after doing checkout using svn? - ruby-on-rails

i have checked out a rails project into my svn repository.now i want to run that project on my local server.I entered rails server command to run it but i am getting an error that it cant find or read .yml file.what are the steps to be taken after one checks out some rails project in order to run it on local server.

cd into the directory containing the Gemfile and then do either rails s or bundle exec rails s. The error you are describing usually happens to me when I am not in the same dir as the Gemfile and Rails cannot find the database.yml file.

Related

rails web config folder does not have the webpack folder eventhough I setup the foder without error?

here is my problem.
I setup a very simple website by rails command and here is my command
rails new freelancer --database=postgresql
and I meet no error
I used postgre sql and postico to test the database and saw the database.
In the file database.yml, there are 2 databases and I ran this command
rails db:setup
rails db:migrate
In postgre sql I also saw the database, maybe it is ok.
But my problem is, I do not see the folder webpack as the tutorial, the folder webpack must like this : (folder) freelancer > (folder) config > (folder) webpack
But I do not see it.
Must I run this command ? To create this folder ?
rails webpacker:install
Could you please give me some advices ? Thank you very much for your time.
Look at Gemfile file, there should be the gem 'webpacker', just run 'bundle install' for installing all the gems that will be used in the project.
If you dont have that one in the Gemfile, just add it like:
gem 'webpacker'
Then it should all be done, but if you still not see the folder, use the command you are saying:
rails webpacker:install

Rails 5 console not working when deploying with Capistrano

I amm using Rails 5, and I have half way deployed my app through Capistrano on server. due to specific need to loadschema, i ssh in and cd into the release/### directory and tried to run
rails --version # came out 5.0.3beta
bundle # works, everything installed
rails c # but this fail
running rails db:migrate also failed.
it seems to return rails generic help as like my directory isn't a rails directory.
i tried deleting bin folder, but still the same.
anyone know what could be wrong?
thank you
It seems you're using capistrano to deploy your application. Have a look at this issue: https://github.com/capistrano/bundler/issues/45
The solution would be:
remove bin from the linked_dirs
add set :bundle_binstubs, nil to your config/deploy.rb to generate the binstubs
To run the console try rails console. To run a migration try rake db:migrate

using github for windows can't start rails server after pulling a repo

I added some collaborators to a rails project on github. They pull down the project using github for windows but then cannot start the rails server
rails server gives them the same output as typing rails
When we do ls we get:
From the Github directory I tried chmod -R 777 sindika but it didn't work. Why can't they pull down the project and start the server?
Seems like the version of your globally installed rails gem is different from the one the project is built on, so Rails don't recognize this folder as its project. Doing bundle && bundle exec rails s should do the trick. Another way to solve this would be to uninstall the current version of the Rails gem and install the one that corresponds to your project.

"rails server" command is not getting recognized

I am new to rails and am following the tutorial posted on the ROR website. Everything is working fine until I try and load up my rails application on the localhost. Every time enter $ rails server I get a long list of possible commands and functions. When I check my localhost:3000 and 127.0.0.1:3000, nothing seems to be connected.
Upon digging deeper, I have tried almost everything everyone else has tried. I am running the command in the same path as my new rails application. Furthermore, when I enter in nonsense after the $ rails command I get the same list of possible commands and functions. So I get the feeling that rails is not recognizing the server command.
Here are my versions:
Ruby 1.9.3 p374
Rails 3.2.11
Why isn't the server command recognized?
First of all you have to move to the project directory and install bundle with the following command:
bundle install
Then start the server:
rails server
I had the same problem. rails server or simply rails s only works when you are in the right directory.
Type pwd (present working directory) to see where you currently are.
Type cd and the rest of the direction to the correct directory.
(for example, "cd workspace/learn-rails")
Type rails server or rails s.
Check http://localhost:3000.
Please exit from terminal and then restart the terminal.
Then check the directory path i.e just type pwd it will show the current directory path.
And if directory is correct on try again running command like bundle install & rails server
I think this should be work.

RoR Question: Where's script/server?

I'm following Head First Ruby, and found out that the server file inside the script folder of my first project is missing. I followed this Ubuntu installation tutorial (sorry, Spanish link, still should be easy to follow the commands) and I guess some files/packages are missing. How I can get them?
antonio#antonio-desktop:~/Documents/tickets$ ruby script/server
ruby: No such file or directory -- script/server (LoadError)
antonio#antonio-desktop:~/Documents/tickets$ ls
app config.ru doc lib public README test vendor
config db Gemfile log Rakefile script tmp
antonio#antonio-desktop:~/Documents/tickets$ cd script
antonio#antonio-desktop:~/Documents/tickets/script$ ls
rails
If you're running Rails 3, it's now:
./script/rails server
All of the separate rails scripts in the scripts directory run through the single ./script/rails dispatcher now. This works for the console and other things you may be looking for as well (ie: ./script/rails console).

Resources