locomotivecms / wagon

Wagon is a command line tool that let's you develop for Locomotive right on your local machine.
https://www.locomotivecms.com
MIT License
188 stars 117 forks source link

Can't deploy site locally #207

Closed alvinkatojr closed 8 years ago

alvinkatojr commented 10 years ago

I get the following error when attempting to deploy my locomotive site locally: unable to get an API token: Connection refused - connect(2) for "localhost" port 8000

But when I change the host to locomotivehosting, the deployment is a success. What could be the problem?

did commented 10 years ago

hi @alvinkatojr , what's in your config/deploy.yml file? Are you sure your engine has been correctly installed and runs on the port 8000?

alvinkatojr commented 10 years ago

hi @did this is what I have in my config/deploy.yml file: development: host: localhost:8080 api_key: *****

I am certain I installed engine properly, since I was following the wisdom for wanderers tutorial on the site. Here is a link to my repo. I hope I have n't missed anything.

alvinkatojr commented 10 years ago

hi @did I am still stuck on this issue even after making sure my deploy.yml file is ok. Any help would be appreciated.

did commented 10 years ago

hey @alvinkatojr, alright, let's debug it step by step. could you run the following commands in your terminal?

  1. netstat -an | grep 8080
  2. curl -I http://localhost:8080 thanks!
alvinkatojr commented 10 years ago

Hi @did thanks for the quick response. I just ran the commands here is my output: curl: (7) Failed to connect to localhost port 8080: Connection refused

did commented 10 years ago

it seems that your LocomotiveCMS engine (the rails application, not Wagon) is not running currently. Are you sure it runs on the 8080 port and not the 8000 instead, or another port?

alvinkatojr commented 10 years ago

Hi @did seems I am lost again. Could you tell me if these 2 gems are the same or different: gem 'locomotive_cms', '~> 2.4.1', :require => 'locomotive/engine' and gem 'locomotivecms_wagon', '1.4.0'

did commented 10 years ago

there are different. Wagon is the tool you install locally on your machine in order to create locomotivecms sites. The Engine (locomotive_cms) is the Rails app you have to install in production in order to have the back-office for editing all your websites and rendering the sites in a production mode. You can still render sites with Wagon and it does come up with the back-office and the data won't be persisted.

alvinkatojr commented 10 years ago

I see. Thanks @did. Seems I confused the 2 and missed the engine gem. I am running bundle install now.

did commented 10 years ago

You also can run the Engine locally (on your machine) for testing purpose if you need to.

alvinkatojr commented 10 years ago

Yes thats actually what I want. I was n't able to do that from the get govbut lets see what happens after bundler is done.

On Fri, Aug 15, 2014 at 4:08 PM, Didier Lafforgue notifications@github.com wrote:

You also can run the Engine locally (on your machine) for testing purpose if you need to.

— Reply to this email directly or view it on GitHub https://github.com/locomotivecms/wagon/issues/207#issuecomment-52303390.

alvinkatojr commented 10 years ago

Bundle is complete but this command is not working: Run bundle exec rails g locomotive:install

It instead gives me options that I would get if I ran rails without specifying an app name or a particular instruction. I have all the gems now especially engine and I still can't get it to run locally.

did commented 10 years ago

did you follow these steps (assuming you're on mac): http://doc.locomotivecms.com/get-started/install-engine-locally#mac?

alvinkatojr commented 10 years ago

Yes @did. Those are the steps am using. Everything is working save for Step 4.(I am using Ubuntu 14.04 LTS).

did commented 10 years ago

could you copy/paste the output of bundle exec rails g locomotive:install please? Make sure you run the command from the Engine root folder.

alvinkatojr commented 10 years ago

Here it is @did. Usage: rails new APP_PATH [options]

Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice

Default: /home/alvin/.rbenv/versions/2.1.2/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], [--no-skip-gemfile] # Don't create a Gemfile [--skip-bundle], [--no-skip-bundle] # Don't run bundle install -G, [--skip-git], [--no-skip-git] # Skip Git ignores and keeps -O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files -S, [--skip-sprockets], [--no-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], [--no-skip-javascript] # Skip JavaScript files [--dev], [--no-dev] # Setup the application with Gemfile pointing to your Rails checkout [--edge], [--no-edge] # Setup the application with Gemfile pointing to Rails repository -T, [--skip-test-unit], [--no-skip-test-unit] # Skip Test::Unit files [--old-style-hash], [--no-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], [--no-pretend] # Run but do not make any changes -q, [--quiet], [--no-quiet] # Suppress status output -s, [--skip], [--no-skip] # Skip files that already exist

Rails options: -h, [--help], [--no-help] # Show this help message and quit -v, [--version], [--no-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.

alvinkatojr commented 10 years ago

I get that even though am not creating a new rails app and after installing engine successfully.

did commented 10 years ago

could you copy/paste the Gemfile of your Rails app please? you're going to make it @alvinkatojr !

alvinkatojr commented 10 years ago

Thanks @did, I really appreciate it. Here is my Gemfile.

source 'https://rubygems.org'
gem 'locomotivecms_wagon', '1.4.0'
gem 'locomotive_cms', '~> 2.4.1', :require => 'locomotive/engine'
group :development do
  # Mac OS X
  gem 'rb-fsevent', '~> 0.9.1', require: RUBY_PLATFORM.include?('darwin') && 'rb-fsevent'
  # Unix
  gem 'therubyracer', require: 'v8', platforms: :ruby
  gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
  # Windows
  gem 'wdm', '>= 0.1.0', require: RUBY_PLATFORM =~ /mswin|mingw/i && 'wdm'
end
group :misc do
  # Add your extra gems here
  # gem 'susy', require: 'susy'
  # gem 'redcarpet', require: 'redcarpet'
  gem 'unicorn'
end
did commented 10 years ago

add gem 'rails', '3.2.17' at the top of your Gemfile and remove gem 'locomotivecms_wagon', '1.4.0'

alvinkatojr commented 10 years ago

I have updated the Gemfile as asked. But I get the same output :(

did commented 10 years ago

even after having run `bundle install?

did commented 10 years ago

btw, use the v2.5.5 version of locomotive_cms instead.

alvinkatojr commented 10 years ago

Just upgraded to 2.5.5 and ran bundle install again and I get the same result. I wonder whats the issue.

did commented 10 years ago

This is my Gemfile.

source 'https://rubygems.org'

# ruby '2.1.0'

gem 'rails', '3.2.17'

# Stable engine
gem 'locomotive_cms', '~> 2.5.5', require: 'locomotive/engine'

# Server
gem 'unicorn'

group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
  gem 'uglifier'
  gem 'compass-rails'
  gem 'jquery-rails'
  gem 'therubyracer', platforms: :ruby
end

Also, could you please post the output of "gem list | grep rails" please?

alvinkatojr commented 10 years ago

Hi @did here is the output:

autoprefixer-rails (2.2.0.20140804)
canonical-rails (0.0.7)
codemirror-rails (3.24)
coffee-rails (4.0.1, 3.2.2)
compass-rails (1.1.7)
factory_girl_rails (4.2.1)
font-awesome-rails (4.1.0.0)
jquery-rails (3.1.1, 3.1.0, 3.0.4, 2.1.4)
jquery-ui-rails (4.1.2)
locomotive-aloha-rails (0.23.2.2)
locomotive-tinymce-rails (3.5.8.2)
money-rails (0.12.0, 0.9.0)
mongo_session_store-rails3 (4.1.1)
rails (4.1.4, 4.1.2, 4.1.1, 4.0.2, 3.2.19, 3.2.17, 3.2.16, 3.2.15)
rails-backbone (0.7.2)
rails_12factor (0.0.2)
rails_serve_static_assets (0.0.2)
rails_stdout_logging (0.0.3)
rspec-rails (2.14.2, 2.14.1)
sass-rails (4.0.3, 4.0.1)
select2-rails (3.5.9)
sprockets-rails (2.1.3, 2.0.1)
alvinkatojr commented 10 years ago

And here is my Gemfile:

source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '3.2.17'
gem 'locomotive_cms', '~> 2.5.5', :require => 'locomotive/engine'
group :development do
  # Unix
  gem 'therubyracer', require: 'v8', platforms: :ruby
  gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM.include?('linux') && 'rb-inotify'
end
group :misc do
  # Add your extra gems here
  # gem 'susy', require: 'susy'
  # gem 'redcarpet', require: 'redcarpet'
  gem 'unicorn'
end
did commented 10 years ago

Hmmm, werid. when I run bundle exec rails -v inside my Rails app with the locomotive_cms gem, it returns Rails 3.2.17.

I'm sorry but are you sure, you run bundle exec rails generate locomotive:install inside your LocomotiveCMS (not Wagon) folder?

I suggest that you start from the beginning of the documentation (sometimes, it helps to begin from scratch), without worrying about Wagon and stuff like that.

alvinkatojr commented 10 years ago

When I run bundle exec rails -v I get the rails version number just like you.

Could you explain what you mean by inside the "LocomotiveCMS folder". Because all I can see from my end is just a rails app and I am running the commands inside the root directory. Is n't that how its meant to be?

did commented 8 years ago

I'm closing it since a lot of things have been changed in Wagon v2 (Locomotive V3)

alvinkatojr commented 8 years ago

No worries @did. This was like 2 years ago and everything is running fine. I should have mentioned that ages ago. Thanks for the help!