0

Please bear with me as I am a newbie at RoR and a first time poster on stackoverflow. I am using the cloud9 ide.

I am trying to set up user management with Stormpath, using the stormpath-rails gem, found here: https://github.com/stormpath/stormpath-rails

After following the directions, in the above link, I visited my application after starting my rails server, the index page showed column names fine but when I went to add a new entry, it gave me a controller error.

"LocalJumpError in UsersController#new"

Unexpected return

def new
  @user = User.new
end

I initially tried integrating the gem with an app I already had started but that wasn't working so I started a fresh app just to troubleshoot the Stormpath implementation. Now, I am confident that I followed the directions in the stormpath-rails link, provided above, with the exception of the two steps, below, which I wasn't confident about. I inserted the two lines starting with "export" (using my own file locations and Stormpath application URLs) into my .bashrc file (maybe this is where I went wrong?)

Create a Stormpath developer account and create your API Keys downloading the "apiKey.properties" file into a ".stormpath" folder under your local home directory. So that the Rails gem knows where to find this file, add an environment variable called STORMPATH_API_KEY_FILE_LOCATION whose value is the full path to this new .properties file:

export STORMPATH_API_KEY_FILE_LOCATION="/Users/john/.stormpath/apiKey.properties"

Through the Stormpath Admin interface, note your application's REST URL. You'll want to create an environment variable called "STORMPATH_APPLICATION_URL" whose value is this URL. For example, add into your ~/.bashrc file on OS X:

export STORMPATH_APPLICATION_URL="https://api.stormpath.com/v1/applications/YOUR_APP_ID

Judging by what the terminal session is listing, shown below, it almost looks like the server isn't allowing a necessary ip address to interact with the application. Do I need to whitelist the 66.186.164.130 ip address?

Started GET "/users/new" for 66.186.164.130 at 2015-03-09 19:29:05 +0000 Cannot render console from 66.186.164.130! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255 Processing by UsersController#new as HTML Completed 500 Internal Server Error in 3ms

Please let me know if there is anything additional I can provide.

Community
  • 1
  • 1

1 Answers1

0

Maybe can help, I had a similar problem with cloud9 ide and stormpath, just that I worked on a node.js environment. So, like you I created a .bashrc file with the env var needed. But it looks like icloud9 doesn't take these environment vars, so I read in another post that you have to define these vars (manually, one by one), on the ENV corner when running the application, attached image where you have to define the vars. enter image description here

pxx
  • 21
  • 2