I have upgraded rails 4.2.11.1 to 5.2.8.1, and ActionMailer stopped working within Rspec.
When I run this simple welcome email (described on their page):
UserMailer.with(user: #user).welcome_email.deliver_now
It returns the following internal server error (500):
Unable to find a browser command. If this is unexpected,
Please rerun with environment variable LAUNCHY_DEBUG=true
or the '-d' commandline option and file a bug at
https://github.com/copiousfreetime/launchy/issues/new
I have the following configuration:
config.action_mailer.delivery_method = :test
When running with the env var LAUNCHY_DEBUG=true it returns:
InternalMailer#welcome_email: processed outbound mail in 10.0ms
Sent mail to admin#example.com (18.2ms)
Date: Thu, 26 Jan 2023 18:52:30 +0000
From: example#example.com
To: example#example.com
Message-ID: <63d2cbee2134b_d2ad277028a04983aa#238604b1f73f.mail>
Subject: Welcome to My Awesome Site
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html>
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head>
<body>
<h1> testing</h1>
</body>
</html>
The same happens if I try to run it within a controller.
Did I miss any breaking changes?
Related
I've been trying to trigger a build via the Jenkins API so far with no success. I configured a job on 'Trigger builds remotely' and set a token, 'abc'.
Then in postman I did a post to:
$jenkinsurl:$port/job/$jobname/build?token=abc
And the response is:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body>
<h2>HTTP ERROR 403</h2>
<p>Problem accessing /job/DCD%20Specifications/build. Reason:
<pre> No valid crumb was included in the request</pre>
</p>
<hr>
<i>
<small>Powered by Jetty://</small>
</i>
<hr/>
</body>
I also tried to use basic authentication with a valid username and password, but to no avail.
I can use gets to retrieve whatever information I want from the Jenkins API just fine; it's only this post that gives me this problem.
I had Jenkins 2.7 and updated to 2.19.4 and both versions give me this problem. What am I doing wrong here?
Pass in POST headers, "Jenkins-Crumb:5740ac1b614ca59f5dd5ef151b2895b3".
Your Crumb can be obtained from the URL http://jenkins:8080/crumbIssuer/api/xml
In the POST body, use the appropriate Jenkins XML API request.
Here is my Postman images with parameters:
This worked for me:
Obtain crumb
$ wget -q --auth-no-challenge --user yourUserName --password yourPassword--output-document - 'http://myJenkins:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)'
Now run the Jenkins job
$ curl -I -X POST http://yourUserName:yourPassword#myJenkins:8080/job/JOBName/build -H "Jenkins-Crumb:44e7038af70da95a47403c3bed5q10f8"
HTTP/1.1 201 Created
Date: Fri, 28 July 2017 09:15:45 GMT
X-Content-Type-Options: nosniff
Location: http://myJenkins:8080/queue/item/17/
Content-Length: 0
I am using CentOS 6.5, when I am giving the following command, curl is working fine and it returns me a proper output:
curl --data "atoken=0564af8vabe91f2d1a82fb1j375345733e35b707" http://www.mywebsite.com/something.json
However, I need the same thing on my local machine. In this case, it's not working:
curl --data "atoken=0564af8vabe91f2d1a82fb1j375345733e35b707" http://localhost/something.json
It gives errors and the output like:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Action Controller: Exception caught</title>
<style>
body {...
Please help.
Also, how can I get the atoken for localhost?
Curl is working... what's not working is the JSON service. It's expecting data that it's not getting, or it's not configured correctly on localhost.
I'm receiving this error:
Class#new_employee_survey_email failed with ActionView::Template::Error: uninitialized constant ActionView::CompiledTemplates::Liquid ..
The liquid gem is installed. I can use it in views or in the rails console. I can't get it to work in the email template only.
That template have only several html tags and the call to the Liquid class from their example:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
</head>
<body>
<% #template = Liquid::Template.parse("hi {{name}}") # Parses and compiles the template %>
<%= #template.render( 'name' => 'tobi' ) %>
</body>
</html>
The email is send by delay job if this makes difference.
I will apreciate any help in making this work.
I found the solution:
The jem was successfully found after restarting my box.
Possible reasons - the terminal that had "rake jobs:work" running was not aware of the installation and the addition of the Liquid gem to my gem file.
To not look like complete newby ... :(
I have restarted the rake server and the gem started working on all views/controlers but the mailers
I have restarted the the rake job, but not the console that it is running on ...
I hope this helps others to not waste time ... I'm still feeling newb thought :( ...
I've setup a local gem server for my group on the internal network, and it serves most gems fine, except annotate which needs the gemspec.rz and my server returns a 404 every time it hits it.
I do have the annotate gem installed on the gem server with its quick/marshal/gemspec under specifications, I even manually setup a quick/marshal in the "root" dir, nothing works.
When I do gem generate_index it simply wipes the quick/marshal dir
When I do a bundle install from a dev machine with the local gem server (x.x.x.x) as source, this is what I get
Fetching source index from http://x.x.x.x:8808/
Resolving dependencies...
Net::HTTPNotFound: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
<HEAD><TITLE>Not Found</TITLE></HEAD>
<BODY>
<H1>Not Found</H1>
`/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz' not found.
<HR>
<ADDRESS>
WEBrick/1.3.1 (Ruby/2.0.0/2013-11-22) at
x.x.x.x:8808
</ADDRESS>
</BODY>
</HTML>
# wget http://x.x.x.x:8808/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz
--2014-02-07 14:53:12-- http://x.x.x.x:8808/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz
Connecting to x.x.x.x:8808... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-02-07 14:53:12 ERROR 404: Not Found.
# wget http://rubygems.org/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz
--2014-02-07 14:54:20-- http://rubygems.org/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz
Location: http://production.cf.rubygems.org/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz [following]
--2014-02-07 14:54:20-- http://production.cf.rubygems.org/quick/Marshal.4.8/annotate-2.4.1.beta1.gemspec.rz
Length: 471 [binary/octet-stream]
Saving to: “annotate-2.4.1.beta1.gemspec.rz”
2014-02-07 14:54:21 (48.0 MB/s) - “annotate-2.4.1.beta1.gemspec.rz” saved [471/471]
After deploying my rails 3 app in production I noticed that paths are not always shown in the browser window. For example going to login or my_profile links would still only show http://my_app.com instead of expected http://my_app.com/login or http://my_app.com/my_profile. The views did change and were functional. I could also see the database being hit and views being rendered from the logs (which led me to believe it was not a simple browser cache issue). Going directly to http://my_app.com/login worked, however, using the links in the app would take me to the expected place while leaving the login url displayed. I tried it in several browsers (firefox, opera and chrome) and got the same behavior. The app was deployed under nginx + passenger and later nginx + thin cluster. My question is, whats going on? Could it be nginx settings or my production environment settings? I am not sure where to start.
Running curl -v my_app.com shows
* About to connect() to my_app.com port 80 (#0)
* Trying xx.xx.xx.xx... connected
* Connected to my_app.com (xx.xx.xx.xx) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.1 (x86_64-apple-darwin10.4.0) libcurl/7.21.1 OpenSSL/1.0.0a zlib/1.2.5 libidn/1.19
> Host: my_app.com
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Set-Cookie: ARPT=PKKIKIS10.0.81.64CKILJ; path=/
< Content-Type: text/html; charset=utf-8
< Status: 200
< X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.5
< ETag: "fce6dec3543058bec16175466020a906"
< X-Runtime: 7
< Content-Length: 787
< Cache-Control: private, max-age=0, must-revalidate
< Server: nginx/0.7.62 + Phusion Passenger 2.2.4 (mod_rails/mod_rack)
< P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
< X-Cache: MISS from server.com
< Via: 1.0 server.com:8080
< Connection: close
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>http://my_app.com/</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="generator" content="Hover Redirect Service">
</head>
<frameset framespacing="0" rows="100%,*" cols="100%" frameborder="no" border="0">
<frame name="DDIRECTXYZZY2" scrolling="auto" src="http://xxx.xx.xxx.xxx" noresize>
<frame name="DDIRECTXYZZY" scrolling="no" noresize>
<noframes>
<h1>http://my_app.com/</h1>
<p>Please click here to view the non-framed versi
on.</p>
</noframes>
</frameset>
</html>
So that is clearly a problem. The whole thing gets framed by the DNS redirect? The setup is not Phusion Passenger + nginx. It was originally, but now its thin + nginx. Also, when going directly to ip address of the app, things are just fine. When going to the domain name, I get the framed version. curl -v response of just the ip address also looks normal (like its loading the entire page).
The problem is almost certainly your frames. The inner frame is loading the correct content but because you're (presumably) not targeting 'top' in your links (or whatever it is), the browser is still showing the URL of the outermost frame.
Targeting frames: http://www.w3.org/TR/html4/present/frames.html#h-16.3
If you were not expecting to see frames in your response at all then it's likely they're the responsibility of a shoddy "DNS" service. Get a real DNS address pointed to your server and you'll be singing.
Did you try using another client computer to do your tests? If I follow your explication, that's one option you haven't investigated.
Can you send us your nginx configuration maybe?