0

I am trying to deploy a Rails application with Angularjs on Bluemix. I am using AngularJS for the front end MVC. I am trying to put my application into production and Angularjs is not working.

The application is running fine on my machine. However when deployed in Bluemix it is not working as somehow Angular is not loading.

Even I have tried simple code from the following tutorials:

https://github.com/thedillonb/rails-angularjs-simple-forum

I am finding this so strange:

  • The angular script directory is added into the application.js
  • And the application.html.erb is loading using the:

    <%= javascript_include_tag "application" %>

Then what is going wrong!

Can anyone please help here?

2 Answers 2

1

I would discourage you from vendoring angular.js, and instead recommend using the google cdn for it.

That having been said, and without having seen console output to verify, I'm guessing that you aren't precompiling your assets when you deploy to production.

Sign up to request clarification or add additional context in comments.

1 Comment

the google cdn works like a dream. I have always gone this route.
0

If you are using Rails double check your start command. It should be something like the following.

bundle exec rake db:setup && bundle exec rails s -p $PORT

Additionally you can put this start command in your manifest.yml. My manifest.yml for my ruby on rails app looks like this.

---
applications:
- name: myapp-jbs
  memory: 1GB
  instances: 1
  path: .
  command: bundle exec rake db:setup && bundle exec rails s -p $PORT
  services:
    - postgres-myapp

Additionally I am guessing that for some reason the rake task to generate your assets isn't running. Before you deploy you can run rake assets:precompile to generate your assets.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.